Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

miniscript-core

ayecue514MIT1.5.2TypeScript support: included

Core lexer/parser for MiniScript

miniscript

readme

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