Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aikoven/slice2json

Parser for the Slice language
https://github.com/aikoven/slice2json

Last synced: about 2 months ago
JSON representation

Parser for the Slice language

Awesome Lists containing this project

README

        

# slice2json

Parser for the Slice language.

## Usage

```ts
import {readFileSync} from 'fs';
import {parse} from 'slice2json';

const contents = readFileSync('MySlice.ice', 'utf-8');
const result = parse(contents);
/*
{
"pragmaOnce": true,
"includes": [...],
"modules": {
"type": "module",
"name": "MyModule",
"content": [...]
}
}
*/
```

See [`types.ts`](/src/types.ts) for the schema of returned object.