![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
flatbuffers-addon
Advanced tools
Generate flatbuffers directly from node.
const flatc = require("flatbuffers-addon");
const buffer = flatc.binary(options);
type: String|Buffer
Schema path.
if schema
is a String and schema_contents
is null
or undefined
, schema
will be treated as schema_contents
.
type: String|Buffer
Schema contents.
type: int
schema contents length to parse.
NOT TESTED
type: bool
default: false
Serialize schemas instead of JSON
type: [String]
Include directories for schemas
NOT TESTED
type: String|Buffer
Specify a schema the following schema
should be an evolution of.
if conform
is a String and conform_contents
is null
or undefined
, conform
will be treated as conform_contents
.
NOT TESTED
type: String|Buffer
Conform schema contents.
NOT TESTED
type: [String]
Include directories for conform schemas
NOT TESTED
type: bool
default: false
field names must be / will be quoted, no trailing commas in tables/vectors.
NOT TESTED
type: bool
default: false
Pass non-UTF-8 input through parser
NOT TESTED
type: bool
default: false
Allow fields in JSON that are not defined in the schema. These fields will be discared when generating binaries.
NOT TESTED
type: bool
default: false
Add doc comments to the binary schema files.
const flatc = require("flatbuffers-addon");
const code = flatc.js(options);
NOT TESTED
type: String
ts
to generate TypeScript code.
type: String|Buffer
Schema path.
if schema
is a String and schema_contents
is null
or undefined
, schema
will be treated as schema_contents
.
type: String|Buffer
Schema contents.
type: int
schema contents length to parse.
type: [String]
Include directories for schemas
NOT TESTED
type: String|Buffer
Specify a schema the following schema
should be an evolution of.
if conform
is a String and conform_contents
is null
or undefined
, conform
will be treated as conform_contents
.
NOT TESTED
type: String|Buffer
Conform schema contents.
NOT TESTED
type: [String]
Include directories for conform schemas
NOT TESTED
type: bool
default: false
Removes Node.js style export lines in JS.
NOT TESTED
type: bool
default: false
Uses goog.exports* for closure compiler exporting in JS.
NOT TESTED
type: bool
default: false
Don't include flatbuffers import statement for TypeScript.
NOT TESTED
type: bool
default: true
re-export imported dependencies for TypeScript
const { flatbuffers } = require("flatbuffers");
const flatc = require("flatbuffers-addon");
const schema = `
namespace some.nested.namespace;
file_extension "dat";
table Book {
id:string (id: 0);
title:string (id: 1);
authors:[string] (id: 2);
release:ulong (id: 3);
genres: [ulong] (id: 4);
}
table Library {
name:string (id: 0);
books: [Book] (id: 1);
}
root_type Library;
`;
const js = flatc.js({
schema
});
const library = {
name: "BookShop 0",
books: [{
id: "book-0",
title: "Book 0",
authors: ["Author 0"]
}]
};
const buffer = flatc.binary({
schema,
json: library
});
const deserialized = ((code, binary) => {
// Evalute generated js code
const sandbox = {};
(new Function(code)).call(sandbox);
// @see https://google.github.io/flatbuffers/flatbuffers_guide_use_javascript.html
const bytes = new Uint8Array(binary);
const buf = new flatbuffers.ByteBuffer(bytes);
// Deserialized flatbuffers binary data
const Library = sandbox.some.nested.namespace.Library;
return Library.getRootAsLibrary(buf);
})(js, buffer);
console.log(deserialized.name() === "BookShop 0");
console.log(deserialized.books(0).title() === "Book 0");
FAQs
Node flatbuffers addon
The npm package flatbuffers-addon receives a total of 6 weekly downloads. As such, flatbuffers-addon popularity was classified as not popular.
We found that flatbuffers-addon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.