bookshelf-repl
v0.0.4
Published
A REPL for your Bookshelf.js projects
Downloads
5
Readme
bookshelf-repl
A REPL for your Bookshelf.js projects
Notes
Currently only works with MySQL.
Example
Your code
var
dbRepl = require('bookshelf-repl'),
knex = require('knex').initialize(getKnexConfig()),
options = {
prompt: 'DB> '
};
dbRepl
.start(knex, options)
.then(function(repl) {
repl.on('exit', function onReplExit() {
console.log('Got "exit" event from repl!');
process.exit();
});
})
.catch(console.error);
function getKnexConfig() {
// get your knex configuration from somewhere
return {};
}
The repl
Globals
A few globals are created when the repl starts: