diff --git a/package.json b/package.json index 79aed1d31d501543b81113359db046716c058734..9f3af3b9bb010c5f4b8ea8ec2f3a0e06d54eba88 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]))