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
API
const node = require('rosid-handler-node')
node('index.js').then((data) => {})
node('index.html').then((data) => {})
Rosid
Add the following object to your rosidfile.json, rosidfile.js or routes array. rosid-handler-node will execute all matching JS files in your source folder and save the output as static HTML.
{
"name" : "Node",
"path" : "[^_]*.{html,js}*",
"handler" : "rosid-handler-node"
}
export default (next) => next(null, '<h1>Hello World</h1>')
<h1>Hello World</h1>
Parameters
filePath {String} Absolute path to file.
Returns
{Promise}({String|Buffer}) The transformed file content.