LichenScript is a statically typed language compiler that targets JavaScript and C, version 0.6.3. It offers modern syntax similar to TypeScript/JavaScript, pattern matching, and AOT compilation to C for fast cold start and portability (WebAssembly/Mobile). Its JavaScript target produces readable code with small overhead. It is designed for easy integration with the web ecosystem, providing a lightweight alternative to TypeScript for isolated environments. Active development with monthly releases.
npm install lichenscriptNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compiles a simple LichenScript program with a function and prints the generated JavaScript code.
Use import syntax instead of require(). Ensure your runtime supports ES modules.
Replace { output: 'js' } with { target: 'js' }.Use the '+' operator to concatenate strings.
Install a C compiler and run it on the generated .c file.
Update target values from 'javascript' to 'js'.
Run 'npm install lichenscript' and ensure you are using an ESM project.
Use 'import { compile } from 'lichenscript'' instead of 'import lichenscript from 'lichenscript''.Set 'type': 'module' in package.json or use .mjs file extension.
Replace 'javascript' with 'js' in options.target.
Use compile(code, { target: 'js' }) instead of compile(code, { output: 'js' }).No dependency data recorded yet.