mirror of
https://github.com/corn-config/corn.js.git
synced 2026-07-11 03:16:12 +01:00
Native Typescript Corn parser
- TypeScript 98.9%
- JavaScript 1.1%
| .idea | ||
| src | ||
| test-suite@1e2662bfec | ||
| .gitignore | ||
| .gitmodules | ||
| babel.config.js | ||
| eslint.config.mjs | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| tsconfig.json | ||
Corn.JS
Native Typescript implementation of the Corn parser.
This is compliant with the (currently unfinished) v0.11 spec.
Installation
Add the @cornjs/parser package.
Usage
import { parse } from '@cornjs/parser';
const corn = "{ let $foo = 42 } in { value = $foo }";
const res = parse(corn);
if(res.ok) console.log(res.value); // { value: 42 }