diff --git a/package.json b/package.json index acd19898ef28f21e18c6bd9bc0e4420a783f14c8..e5ee13f17d11e56ffc7f63b13c4431c1a476a97c 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,8 @@ "test:chrome": "cypress run --browser chrome", "__cleanNodeModules": "find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \\;", "build": "NODE_ENV=production pubsweet build", - "seedFromDump": "node scripts/seedFromDump.js" + "seedFromDump": "node scripts/seedFromDump.js", + "console": "node --experimental-repl-await -r ./scripts/preload.js" }, "jest": { "testEnvironment": "node", diff --git a/scripts/preload.js b/scripts/preload.js new file mode 100644 index 0000000000000000000000000000000000000000..6936900ace0c9b19f4e74b223665990981645a03 --- /dev/null +++ b/scripts/preload.js @@ -0,0 +1,3 @@ +const models = require('@pubsweet/models') + +Object.keys(models).forEach(key => (global[key] = models[key]))