Add some info useful for npm site to README.md
This commit is contained in:
parent
ccc320522a
commit
4de80f4304
1 changed files with 17 additions and 1 deletions
18
README.md
18
README.md
|
@ -21,7 +21,23 @@ Gir supports following optimizations:
|
|||
Examples
|
||||
--------
|
||||
`ircbot.js` is an implementation of an IRC bot's brainfuck interpreter
|
||||
function. Smaller examples are available in `api.md`
|
||||
function. Smaller examples for every function are available in `api.md`
|
||||
|
||||
const gir = require('bf-gir');
|
||||
let compiled = gir.compile(',[+.,]');
|
||||
let input = gir.encodeUTF8('Foobar');
|
||||
let vm = gir.newVM(compiled, input);
|
||||
let result = gir.runVM(vm, 1000);
|
||||
|
||||
if(result.completed) {
|
||||
console.log(gir.decodeUTF8(result.state.output));
|
||||
} else {
|
||||
console.log('Bf program terminated abnormally');
|
||||
}
|
||||
|
||||
Installing
|
||||
----------
|
||||
Gir is available at npm registry under the name bf-gir.
|
||||
|
||||
TODO
|
||||
----
|
||||
|
|
Loading…
Reference in a new issue