@surplus/compiler
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Surplus Compiler

This is the base Surplus compiler transformer logic, and a basic CLI utility called surplus-transform.

NOTE: This is only the compiler; it does not include the runtime.

Rust Usage

Check the docs. For now, running cargo doc --open is the best way.

For the CLI utility, run cargo run -- --help for usage.

Javascript Usage

npm install @surplus/compiler

The compiler is usable via a WASM module.

NOTE: The JavaScript package and the Rust crate do not necessarily share the same version numbers. To the extent possible, major and minors will remain synchronized.

import compileSurplus from '@surplus/compiler';

console.log(
	compileSurplus(
		`<div>Hello!</div>`,

		/* Optional arguments (defaults shown) */
		{
			global: '$$S',
			emitRuntimeImport: true
		}
	)
);

License

Licensed under the MIT License.

Package Sidebar

Install

npm i @surplus/compiler

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

1.37 MB

Total Files

12

Last publish

Collaborators

  • qix