Skip to content

An implementation of the Hummingbird parser and serializer for JavaScript.

License

Notifications You must be signed in to change notification settings

echlo/hummingbird-js

Repository files navigation

Hummingbird-JS

This is an implementation of the Hummingbird parser and serializer for JavaScript.

Synopsis

Hummingbird is a binary serialization format. See the spec for details and format specification.

Code Example

const json = { foo: "bar" };
const hbon = Hummingbird.serialize(new Hummingbird.Schema({ foo: Hummingbird.Types.string }), json);

Installing

Include the distribution javascript from the dist folder.

Demo

Here's an online converter

Development

Download this repository and install dependencies via NPM or yarn.

This project uses webpack. To build, simply

npm run webpack

API Reference

(More documentation to follow)

Serializing a JSON object

const hbon = Hummingbird.serialize(schema, object, mapping);
// - schema is a Hummingbird.Schema object
// - object is a JSON object
// - mapping is an optional mapping object for shortkey support

Parsing a HBON object

const json = Hummingbird.parse(object, mapping);
// - object is a JSON object
// - mapping is an optional mapping object for shortkey support

Tests

This project uses Jasmine

npm run test

Contributors

Current maintainer

License

This project is licensed under the MIT License - see the LICENSE file for details

About

An implementation of the Hummingbird parser and serializer for JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published