Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ayecue/miniscript-core
MiniScript Parser & Lexer in TypeScript
https://github.com/ayecue/miniscript-core
Last synced: 29 days ago
JSON representation
MiniScript Parser & Lexer in TypeScript
- Host: GitHub
- URL: https://github.com/ayecue/miniscript-core
- Owner: ayecue
- License: mit
- Created: 2023-10-18T12:07:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-30T13:25:47.000Z (29 days ago)
- Last Synced: 2024-12-30T14:25:22.320Z (29 days ago)
- Language: TypeScript
- Homepage:
- Size: 1.58 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# miniscript-core
[![miniscript-core](https://circleci.com/gh/ayecue/miniscript-core.svg?style=svg)](https://circleci.com/gh/ayecue/miniscript-core)
Basic Lexer and Parser for MiniScript.
## Install
```bash
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
```ts
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
```ts
const content = 'print "hello world"';
const parser = new Parser(content);
const payload = parser.parseChunk(); // AST
```