https://github.com/k-yle/light-characteristics
🛥️🔦 A parser for light characteristics used on nautical charts
https://github.com/k-yle/light-characteristics
Last synced: 10 months ago
JSON representation
🛥️🔦 A parser for light characteristics used on nautical charts
- Host: GitHub
- URL: https://github.com/k-yle/light-characteristics
- Owner: k-yle
- License: mit
- Created: 2023-11-03T01:31:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-09T10:29:27.000Z (about 2 years ago)
- Last Synced: 2025-07-05T08:45:16.135Z (12 months ago)
- Language: TypeScript
- Homepage: https://kyle.kiwi/light-characteristics
- Size: 299 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Light Characteristic Parser
[](https://github.com/k-yle/light-characteristics/actions)
[](https://coveralls.io/github/k-yle/light-characteristics?branch=main)
[](https://badge.fury.io/js/light-characteristics)
[](https://www.npmjs.com/package/light-characteristics)

🛥️🔦 A JavaScript library to encode and decode [light characteristics](https://en.wikipedia.org/wiki/Light_characteristic) used on [nautical charts](https://en.wikipedia.org/wiki/Nautical_chart).
## Install
```sh
npm install light-characteristics
```
## Usage
```js
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'
```
## Try it out
This repository also contains an editor UI, which is [available online](https://kyle.kiwi/light-characteristics).