Skip to content

Commit 7e423b8

Browse files
committed
Add README.
1 parent 42e31c7 commit 7e423b8

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# MODL Interpreter in TypeScript
2+
3+
This repository contains an implementation of a [MODL](https://www.modl.uk/) interpreter in TypeScript.
4+
5+
## Installation With NPM
6+
7+
Use `npm install --save modl-interpreter`
8+
9+
## TypeScript Example
10+
11+
```TypeScript
12+
import { Interpreter } from './modl-interpreter/Interpreter';
13+
14+
const interpreter = new Interpreter();
15+
16+
const jsonString = interpreter.interpretToJsonString('x = a MODL string');
17+
18+
console.log(jsonString);
19+
```
20+
21+
This example produces the output:
22+
```json
23+
{"x":"a MODL string"}
24+
```
25+
26+
## JavaScript Example
27+
28+
```JavaScript
29+
const modl = require('modl-interpreter');
30+
31+
const jsonString = modl.interpreter.interpretToJsonString('x = a MODL string');
32+
33+
console.log(jsonString);
34+
```
35+
This example produces the same output as above.

0 commit comments

Comments
 (0)