Skip to content

Instantly share code, notes, and snippets.

@chrisbolin
Last active November 12, 2015 21:06
Show Gist options
  • Save chrisbolin/e63c0d90d5d73a566159 to your computer and use it in GitHub Desktop.
Save chrisbolin/e63c0d90d5d73a566159 to your computer and use it in GitHub Desktop.

Revisions

  1. chrisbolin revised this gist Nov 12, 2015. No changes.
  2. chrisbolin created this gist Nov 12, 2015.
    17 changes: 17 additions & 0 deletions shell.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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();
    });
    };
    2 changes: 2 additions & 0 deletions shell.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # npm install --global headstone
    headstone shell.js