New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

aivdm-decoder

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aivdm-decoder

Decoded AIS AIVDM Sentences

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

aivdm-decoder

AIVDM (AIS) Decoder module for Node,js

Install: npm install aivdm-decoder

Imports:

  • ESM

import { aivdmDecode } from "aivdm-decoder";

  • CommonJS

const { aivdmDecode } = require('aivdm-decoder');

Example use:

const { aivdmDecode } = require('aivdm-decoder');
const aisDecoder = new aivdmDecode({returnJson: false, aivdmPassthrough: true});

const sentences = [
    "!AIVDM,1,1,,B,15DbCb0PAgbmOBsdJb7AJ@ib00SM,0*34",
    "!AIVDM,1,1,,B,37PAfn0Oj3:lIhEd`Ij9gWmd0Pq1,0*2B",
    "!AIVDM,1,1,,A,1;@1hrh00qKbOaGe9UL<dajd04ht,0*74",
    "!AIVDM,2,1,0,B,53ddOr3SnbKSTP7;;?Q9B0@59LTr22222222220l20@57Hm60@T3lU821@A3,0*41",
    "!AIVDM,2,2,0,B,0CQ88888880,2*3D"
];

sentences.forEach(function (sentence) {
    const decoded = aisDecoder.decode(sentence);
    console.log(decoded)
})

Options:
returnJson:  If true, then the decoded message is returned as JSON, if false, then the decoded message is returned as an object.  Default false
aivdmPassthrough: If true then the raw aivdm message is included in the output as property 'aivdm'.  Default true
includeMID: if true then the nationality of the vessel (derrived from it's mmsi) is returned.  Default true.

Keywords

ais

FAQs

Package last updated on 10 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts