Browse Source

Allow inspecting the API default exports without erroring (#152)

v6-dev
Eli Perelman 8 years ago
committed by GitHub
parent
commit
ebf7879ca6
  1. 12
      packages/neutrino/src/index.js

12
packages/neutrino/src/index.js

@ -1,11 +1,11 @@
const Api = require('./api'); const Neutrino = require('./api');
const { partial } = require('ramda'); const { partial } = require('ramda');
const Future = require('fluture'); const Future = require('fluture');
const { getNodeEnv, toArray } = require('./utils'); const { getNodeEnv, toArray } = require('./utils');
// run :: (String command -> Array middleware -> Object options) -> Future Error a // run :: (String command -> Array middleware -> Object options) -> Future Error a
const run = (command, middleware, options) => { const run = (command, middleware, options) => {
const api = Api(options); const api = Neutrino(options);
process.env.NODE_ENV = getNodeEnv(command, api.options.args && api.options.args.env); process.env.NODE_ENV = getNodeEnv(command, api.options.args && api.options.args.env);
@ -37,10 +37,12 @@ const start = partial(run, ['start']);
const test = partial(run, ['test']); const test = partial(run, ['test']);
module.exports = { module.exports = {
Neutrino: Api, Neutrino,
run, run,
build, build,
inspect,
start, start,
test test,
inspect(middleware, options = {}) {
return options.customInspect ? this : inspect(middleware, options);
}
}; };

Loading…
Cancel
Save