miniscript-core
TypeScript icon, indicating that this package has built-in type declarations

0.6.1 • Public • Published

miniscript-core

miniscript-core

Basic Lexer and Parser for MiniScript.

Install

npm install --save miniscript-core

Lexer

Options

  • validator - define custom validator
  • tabWidth - define the used tab width in file
  • unsafe - will parse invalid MiniScript without throwing (useful for debugging)

Usage

const content = 'print "hello world"';
const lexer = new Lexer(content);
const parser = new Parser(content, { lexer });
const payload = parser.parseChunk(); // AST

Parser

Options

  • validator - define custom validator
  • astProvider - define custom ast provider
  • lexer - define custom lexer
  • tabWidth - define the used tab width in file
  • unsafe - will parse invalid MiniScript without throwing (useful for debugging)

Usage

const content = 'print "hello world"';
const parser = new Parser(content);
const payload = parser.parseChunk(); // AST

/miniscript-core/

    Package Sidebar

    Install

    npm i miniscript-core

    Weekly Downloads

    207

    Version

    0.6.1

    License

    MIT

    Unpacked Size

    213 kB

    Total Files

    73

    Last publish

    Collaborators

    • ayecue