The useful development toolbox for Node.js packages.
# Using NPM
npm install dtb --save-dev
# Using Yarn
yarn add dtb --dev
The server module:
const toolbox = require('dtb')
const server = toolbox.server
// ...
// get a free port
const freePort = await server.getPort()
// ...
// start a temporary server
const temp = await server.startTempServer()
console.log('temp started', temp.host, temp.port)
// stop the temporary server
await temp.stop()
For more check out the docs, source, and tests.
The files module:
const toolbox = require('dtb')
const files = toolbox.files
// ...
// get the normalized path
files.path('/../src/')
// get the normalized path relative to your project's root directory
files.root('/src')
For more check out the docs, source, and tests.
Any contribution is appreciated. To get going, check out the contribution guidelines, then the development manual. Thank you, have fun!