Add some info useful for npm site to README.md

This commit is contained in:
Juhani Krekelä 2018-05-29 20:15:09 +03:00
parent ccc320522a
commit 4de80f4304

View file

@ -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
----