@arv/structs-compiler
v0.2.0
Published
The compiler of @arv/structs: the TC39 structs proposal's syntax (struct, shared struct) compiled to JavaScript, a command line, and a Node load hook; TypeScript projects type checked, with shared struct field access made direct
Maintainers
Readme
@arv/structs-compiler
The compiler of @arv/structs, the TC39
structs proposal for JavaScript today. It
compiles the proposal's syntax, struct and shared struct, to JavaScript that
calls the runtime, @arv/structs, which it needs installed beside it.
npm install @arv/structs
npm install --save-dev @arv/structs-compilerIn Node, its load hook compiles struct syntax as modules load, in workers too:
node --import @arv/structs-compiler/register main.jsThe structs command compiles a single file, or a whole TypeScript project with
type checking. In TypeScript, where the types prove an object is a shared
struct, its field access is made direct, in shared memory:
npx structs transpile main.js
npx structs compile -p tsconfig.jsonFrom code, use transpile(source, {fileName}) and compile(tsconfigPath).
The docs are at structs.arv.tools, and there is a playground at structs.arv.tools/playground.
License
Apache-2.0
