Skip to content

Commit

Permalink
Updated info for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berezin committed Jun 19, 2019
1 parent 21a5bf6 commit 427c6c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is yet another Javascript Implementation.
## Installation

```bash
$ npm install yali.js
$ npm install yalijs
```

## CLI Usage
Expand Down Expand Up @@ -49,11 +49,12 @@ run(source_code, environment = new Environment(), printfn = console.log, debug =

You can pass in an `environment` object, which lets you define built-in variables and functions like so:
```javascript
const { run, Environment } = require('yali')
const { run, Environment } = require('yalijs')
const env = new Environment()
env.setBuiltin('owner', 'dberezin')
env.setBuiltin('meaning_of_life', 42)
env.setBuiltin('alert', (interpreter, arg) => alert(arg[0]))
run('print meaning_of_life;', env)
```

You can also pass in a `printfn` that will be called for every `print` statement. Here's an example for capitalizing each word in the stdout:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "yali",
"name": "yalijs",
"version": "1.0.0",
"description": "Yet Another Lox Interpreter. Javascript Implementation of the Lox Programming Language",
"main": "index.js",
Expand Down

0 comments on commit 427c6c1

Please sign in to comment.