
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
acg-flatbuffers
Advanced tools
Forked by Aaron C Gaudette on 13 Jan. 2017. See here. This is an updated version of the original.
This is an implementation of FlatBuffers in pure JavaScript. Unlike the official compiler, this implementation generates JavaScript code to convert between JavaScript objects and FlatBuffers at run time using the JIT. It currently requires binary schemas compiled with the flatc
compiler, which is written in C++ and has to be built (see the build instructions).
Create a schema called example.fbs
:
table Example {
x: float;
y: float;
}
root_type Example;
Generate the binary schema called example.bfbs
:
flatc --binary --schema example.fbs
Install this library:
npm install acg-flatbuffers
Use the library:
var flatbuffers = require('acg-flatbuffers');
var fs = require('fs');
var example = flatbuffers.compileSchema(fs.readFileSync('example.bfbs'));
var generated = example.generate({ x: 1, y: 2 });
var parsed = example.parse(generated);
console.log('generated:', Array.from(generated));
console.log('parsed:', parsed);
Running that code should print this:
generated: [ 12, 0, 0, 0, 8, 0, 12, 0, 8, 0, 4, 0, 8, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63 ]
parsed: { x: 1, y: 2 }
FAQs
An implementation of FlatBuffers in pure JavaScript
The npm package acg-flatbuffers receives a total of 22 weekly downloads. As such, acg-flatbuffers popularity was classified as not popular.
We found that acg-flatbuffers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.