The NodeJS binding relies on the Neon project.
Please, see the README.md
of the project, but
basically, it reduces to:
$ just build-nodejs
Usage example:
const gutenberg_post_parser = require('bindings/nodejs/native');
console.log(
gutenberg_post_parser.root('<!-- wp:foo /-->')
);
The ./bin/gutenberg-post-parser
executable is a NodeJS script using
the NodeJS native module to parse a Gutenberg post and to emit either
JSON or debug data.
$ ./bin/gutenberg-post-parser --emit-json ../../tests/fixtures/autoclosing-block.html