light-characteristics
v1.0.0
Published
🛥️🔦 A parser for light characteristics used on nautical charts
Downloads
60
Maintainers
Readme
Light Characteristic Parser
🛥️🔦 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'