Commit 843ca43d authored by Chris Lord's avatar Chris Lord

Librify Ferris and separate out example use

parent 2bafb3af
const Ferris = require('./index');
const Readline = require('readline');
// Load skills
var skills = Ferris.loadSkills('skills');
Ferris.listen(skills, () => { rl.close(); });
// Provide a keyboard prompt
var rl = Readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.on('line', command => {
rl.pause();
Ferris.parseCommand(skills, command, () => { rl.close(); });
Ferris.restartSTT(skills, true);
// Unpause and refresh the prompt
rl.prompt();
}).on('close', () => {
// Clean-up
Ferris.quiet();
if (Ferris.activeSkill) {
Ferris.endSession(Ferris.activeSkill);
}
process.exit(0);
});
rl.prompt();
This diff is collapsed.
......@@ -2,14 +2,22 @@
"name": "ferris",
"version": "0.0.1",
"description": "Offline Alexa skills",
"author": "Chris Lord",
"license": "GPLv3",
"author": {
"name": "Chris Lord",
"email": "contact@chrislord.net",
"url": "http://chrislord.net/"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/Cwiiis/ferris.git"
},
"main": "index.js",
"dependencies": {
"concat-stream": "1.5.1",
"mic": "2.0.1",
"nlp_compromise": "4.10.6",
"pocketsphinx": "5.0.5",
"request-promise": "1.0.2",
"which": "1.2.9"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment