Skip to content

konsumer/rawproto-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rawproto-wasm

Decode protobuf in raw form, in wasm (for node, deno, cf workers, etc.) Based on decode_raw, which is a rad CLI tool for looking at binary protobuf.

You can see a web-demo here

This has some ideas in common with rawproto, but marks a different direction that can parse a bit faster, and eventually handle partial parsing (mixing proto def with raw fields.)

usage

First intall it in your project:

npm i rawproto-wasm

Now, use it like this:

import { getString, parseRaw } from 'rawproto-wasm'
import { readFile } from 'fs/promises'

const binary = await readFile('test.bin')
console.log(await parseRaw(binary, '.'))
console.log(await getString(binary, '.2'))

dev

# build the module
npm run build 

About

Decode protobuf in raw form, in wasm (for node, deno, cf workers, etc.) Based on decode_raw.

Resources

License

Stars

Watchers

Forks

Packages

No packages published