A very simple Node.JS library intended to speed up the coding time and reduce the file length (and therefore ending up with more readable code) in simple express projects.
I don't see any reason not to use this on larger projects too if you like the simplicity, but it is designed with simple projects in mind.
The package is aviable in the npm registry. You can install it on the command line using the following command:
npm i express-shortcuts
There are two ways to use the library.
Import only the functions needed on each file.
const { send } = require('express-shortcuts');
app.get('/', send('Hello!'));
Import once at the start and use the functions everywhere.
// index.js
require('express-shortcuts')._inject();
// hi.js
app.get('/hi', send('hi'));
// bye.js
app.get('/bye', render('bye_page'));