npm.io
0.0.36 • Published 2 years ago

alins-compiler-node

Licence
MIT
Version
0.0.36
Deps
4
Size
7 kB
Vulns
0
Weekly
0
Stars
85

stars forks version downloads jsdelivr visitors

author license Size TopLang issue Dependent

Alins: The most pure and elegant WebUI framework

中文 | Documentation | Playground | Update Log | Feedback Errors/Defects | Gitee | Message Board

alins-compiler-node

alins-compiler-node is the alins compiler in the nodejs environment. All the above plug-ins encapsulate the compilation functions implemented by this tool. They are used as follows:

const {parseAlins} = require('alins-compiler-node');
const code = 'let a=1; a++;';
const result = parseAlins(code);

The parseAlins method is an optional configuration item with three optional attributes:

  1. ts: Whether to support typescript compilation, the default is false
  2. importType: the way to introduce alins, optional values ​​are esm, cjs, iife. The default value is esm, which means using the import statement to introduce alins
  3. filename: current code module file name, automatically generated by default
const {parseAlins} = require('alins-compiler-node');
const code = 'let a=1; a++;';
const result = parseAlins(code, {
     ts: false,
     importType: 'esm',
     filename: 'test.tsx',
});

Keywords