From 4de80f43049321569cf79f3ab970773c3e0e5ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Tue, 29 May 2018 20:15:09 +0300 Subject: [PATCH] Add some info useful for npm site to README.md --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb0cec8..594f793 100644 --- a/README.md +++ b/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 ----