Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nautical-charts

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nautical-charts

A library for reading nautical chart files.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

nautical-charts

GitHub Workflow Status npm GitHub

A pure JavaScript library for reading nautical chart files. In particular, for reading BSB-formatted (.bsb and .kap) files.

Installation

$ npm install nautical-charts --save

API Reference

Classes

MemoryStream

A readable stream for an in-memory byte array.

Functions

parseChart(stream)

Parses a BSB chart from a readable (e.g. file) stream.

parseMetadata(textSegment)

Parses the text segment of a BSB chart and returns well-known metadata, if present.

writeRasterSegment(rasterSegment, palette, buffer, bufferWidth)

Writes the RLE encoded raster data of a BSB chart to a bitmap.

MemoryStream

A readable stream for an in-memory byte array.

Kind: global class

new MemoryStream(contents, options)

The constructor for the MemoryStream

ParamDescription
contentsThe array from which to read.
optionsAn optional set of readable stream options.

parseChart(stream) ⇒

Parses a BSB chart from a readable (e.g. file) stream.

Kind: global function
Returns: A BSB chart.

ParamDescription
streamThe stream from which to read the chart data.

parseMetadata(textSegment) ⇒

Parses the text segment of a BSB chart and returns well-known metadata, if present.

Kind: global function
Returns: The metadata parsed from the chart.

ParamDescription
textSegmentThe text entries of the chart.

writeRasterSegment(rasterSegment, palette, buffer, bufferWidth)

Writes the RLE encoded raster data of a BSB chart to a bitmap.

Kind: global function

ParamDescription
rasterSegmentThe rows of raster data for the chart.
paletteThe palette from which to obtain pixel values.
bufferThe bitmap buffer in which to write the chart raster data.
bufferWidthThe width of the bitmap buffer.

License

MIT (see LICENSE.md)

FAQs

Package last updated on 12 May 2021

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