Last active
November 12, 2015 21:06
-
-
Save chrisbolin/e63c0d90d5d73a566159 to your computer and use it in GitHub Desktop.
Keystone.js REPL Shell (using Headstone)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var repl = require('repl'), | |
keystone = require('keystone'); | |
module.exports = function(done) { | |
var shell = repl.start({ | |
prompt: 'keystone > ' | |
}); | |
// expose keystone to the shell | |
shell.context.keystone = keystone; | |
// stop headstone on shell exit | |
shell.on('exit', function(){ | |
console.info('exiting keystone shell...'); | |
done(); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# npm install --global headstone | |
headstone shell.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment