1.0.0 ā€¢ Published 6 months ago

light-characteristics v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Light Characteristic Parser

Build Status Coverage Status npm version npm npm bundle size

šŸ›„ļøšŸ”¦ A JavaScript library to encode and decode light characteristics used on nautical charts.

Install

npm install light-characteristics

Usage

import { decodeLight, encodeLight } from 'light-characteristics';

const light = decodeLight('AeroF.RY.5m');
light; // -> { LITCHR: 'F', COLOUR: ['R', 'Y'], HEIGHT: 5, CATLIT: 'aero' }

const encoded = encodeLight({
  LITCHR: 'F',
  COLOUR: ['R', 'Y'],
  HEIGHT: 5,
  CATLIT: 'aero',
});
encoded; // -> 'AeroF.RY.5m'