rosid-handler-node

A function that loads a JS file and transforms it to HTML by executing the exported default function.
Install
npm install rosid-handler-node
Usage
const node = require('rosid-handler-node')
node('/src/index.js', '/src', '/dist', {}).then(({ data, savePath }) => {})
node('/src/index.html', '/src', '/dist', {}).then(({ data, savePath }) => {})
Parameters
filePath {String} Absolute path to the requested file.
srcPath {String} Absolute path to the source folder.
distPath {?String} Absolute path to the export folder.
route {Object} The route which matched the request URL.
Returns
{Promise}({Object})
data {String | Buffer} The transformed file content.
savePath {?String} Where to save the file when compiling.