New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mmsi.js

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

mmsi.js

Maritime Mobile Service Identity (MMSI) parsing utilities

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by12.5%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Code coverage Open issues NPM package License

mmsi.js

A javascript library for parsing MMSI numbers (Maritime Mobile Service Identities) to validate format and extract information such as country or other jurisdiction of registration.

About

From Wikipedia:

A Maritime Mobile Service Identity (MMSI) is a series of nine digits which are sent in digital form over a radio frequency channel in order to uniquely identify ship stations, ship earth stations, coast stations, coast earth stations, and group calls.

With mmsi.js you can determine whether a given number or string is in the format of a valid MMSI and, if so, extract the Maritime Identification Digits from it, along with the corresponding country name and code.

Note that this library makes no attempt to verify that a given MMSI is actually in active use, or registered to a real vessel.

Installation

npm install mmsi.js

Usage

import { MMSI } from 'mmsi.js';

const mmsi = new MMSI(1234567890);
console.log(mmsi.isValid); // false -- too many digits
mmsi.identity = "ABCDEFGHI";
console.log(mmsi.isValid); // false -- not exclusively digits

mmsi.identity = 123;
console.log(mmsi.isValid); // true
console.log(mmsi.formatted); // "000000123"

mmsi.identity = "410123456";
console.log(mmsi.midCode); // "410"
const jurisdiction = mmsi.jurisdiction;
console.log(jurisdiction.code); // "BT"
console.log(jurisdiction.name); // "Bhutan"
console.log(jurisdiction.fullName); // "Bhutan (Kingdom of)"

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

FAQs

Package last updated on 19 Aug 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc