Giter Club home page Giter Club logo

js-protobuf's Introduction

JavaScript Protobuf

DEMO

A JavaScript library for decoding the ProtocolBuffers wire format (with or without a schema). This is work in progress.

This library is tested on a Prague OSM extract file by BBBike.org: https://download.bbbike.org/osm/bbbike/Prag/

It is validated against https://protogen.marcgravell.com/decode

The ProtoBuf wire format is documented at: https://developers.google.com/protocol-buffers/docs/encoding

To run it locally, run it using npx serve . as it uses fetch to get the PBF file which doesn't work off the file:// protocol in Chrome (does in Firefox).

To-Do

Recognize strings whose embedded content is just the same string

(length diff = length varint byte length) and collapse the embedded content into one entry (not one parent one child).

Extend the library to cover both scenarios without and with a schema

Parse https://github.com/substack/osm-pbf-parser/blob/master/lib/osmformat.proto to find structures and then parse the Prague extract into those structures.

Compare my implementation with NNN.js

https://github.com/photopea/UNN.js/blob/master/UNN.util.js#L135

Use getVarint from my ESM varint library

https://github.com/TomasHubelbauer/esm-dataview-getvarint

js-protobuf's People

Contributors

tomashubelbauer avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.