npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ais-json

v0.1.2

Published

AIS.js Lib

Downloads

9

Readme

ais-json

A npm package about AIS (Automatic Identification System) text decoding.

Decode AIS text, then return JSON object.

npm address: https://www.npmjs.com/package/ais-json

Structure

Name | Description ---|--- index.js | main function (call decode.js and include verify ais text) encode.js | generate ascii6bit.json and num2char.json decode.js | decode ais text and return json (base on ascii6bit.json and num2char.json) ascii6bit.json | connect ascii to 6 bit code num2char.json | connect number to char

Install

npm install ais-json

Usage

In Terminal

npx ais '!AIVDM,1,1,,A,15Cgah00008LOnt>1Cf`s6NT00SU,0*3D'

Then, you will get:

{
  "MessageID": {
    "name": "消息ID",
    "data": 1,
    "info": "船位报告"
  },
  "DataIndicator": {
    "name": "转发指示符",
    "data": 0,
    "info": "默认"
  },
  "UserID": {
    "name": "用户ID(MMSI)",
    "data": 356248000,
    "info": 356248000
  },
  "NaviStatus": {
    "name": "导航状态",
    "data": 0,
    "info": "发动机使用中"
  },
  "ROT": {
    "name": "旋转速率",
    "data": "0°/min",
    "info": "0°/min"
  },
  "SOG": {
    "name": "地面航速",
    "data": "0节",
    "info": "0节"
  },
  "Accuracy": {
    "name": "地面航速",
    "data": 0,
    "info": "高(<10m)"
  },
  "Location": {
    "name": "坐标",
    "data": [118.07354333333333, 24.502496666666666],
    "info": "E 118°4.4126′ , N 24°30.1498′"
  },
  "COG": {
    "name": "地面航线",
    "data": "228.4°",
    "info": "228.4°"
  },
  "Heading": {
    "name": "实际航向",
    "data": "207°",
    "info": "207°"
  },
  "Second": {
    "name": "时戳",
    "data": 18,
    "info": "18 seconds past the minute"
  },
  "RegionalApplication": {
    "name": "特定操纵指示符",
    "data": 0,
    "info": "不可用"
  },
  "Spare": {
    "name": "备用",
    "data": 0,
    "info": "未使用"
  },
  "RAIM": {
    "name": "RAIM",
    "data": 0,
    "info": "RAIM未使用"
  },
  "CommunicationState": {
    "name": "通信状态",
    "data": "0000000100011100101",
    "info": "SOTDMA 4:57 UTC"
  },
  "text": "!AIVDM,1,1,,A,15Cgah00008LOnt>1Cf`s6NT00SU,0*3D"
}

In Project

Decode AIS Text

# const ais = require('ais-json')
import ais from 'ais-json'
let aisinfo = ais('!AIVDM,1,1,,A,15Cgah00008LOnt>1Cf`s6NT00SU,0*3D')

Open SerialPort

If you need it.

node-serialport

cd ais-json
node serialport

Default

Port: COM3
BaudRate: 38400

Encode Table

cd ais-json
node encode

Generate ascii6bit.json and num2char.json.

Intend

  • [ ] CLI