@mattnucc/gribberish
v0.30.2
Published
JavaScript bindings for gribberish, a GRIB2 parsing library
Maintainers
Readme
@mattnucc/gribberish
Node.js bindings for gribberish, a Rust GRIB2 reader.
This package is a reader only. Loading GRIB2 bytes from local files, object stores, or network sources is intentionally left to your application.
Install
yarn add @mattnucc/gribberishor
npm install @mattnucc/gribberishUsage
Read the first message in a GRIB2 file:
import { readFileSync } from 'node:fs'
import { GribMessageFactory } from '@mattnucc/gribberish'
const data = readFileSync('sample.grib2')
const factory = GribMessageFactory.fromBuffer(data)
const first = factory.getMessage(factory.availableMessages[0])
console.log(first.varName, first.gridShape.rows, first.gridShape.cols)Common entry points:
parseMessagesFromBuffer(buffer)to parse all messages.GribMessage.parseFromBuffer(buffer, offset)to parse one message at a known offset.GribMessageFactory.fromBufferto scan and fetch messages by key.GribMessageMetadataFactory.fromBufferfor metadata-first access.
WebAssembly targets
WebAssembly packages are optional, so install with a wasm target selector instead of adding the package explicitly.
- npm (v10.2+):
npm install --cpu=wasm32 @mattnucc/gribberish- yarn v4:
# .yarnrc.yml
supportedArchitectures:
cpu:
- current
- wasm32Then run yarn install.
In Node, set NAPI_RS_FORCE_WASI=1 (or NAPI_RS_FORCE_WASI=error) if you want to force the WASM runtime path.
Build and test
yarn installyarn buildyarn test
Requirements
- Rust toolchain
- Node.js (CI validates on 20/22; release jobs run on 24)
- Yarn 4.x (
packageManager: [email protected])
Release workflow
The js workflow publishes artifacts from GitHub Actions when you push a version tag.
npm version [major | minor | patch | ...]git push --follow-tags
Make sure NPM_TOKEN is set in repository secrets.
Do not run
npm publishmanually.
