node-renderdeprecated

This module allow to you render any string (specially html) using phantomJs.

Usage no npm install needed!

<script type="module">
  import nodeRender from 'https://cdn.skypack.dev/node-render';
</script>

README

node-render NPM version Build Status Dependency Status Coverage percentage

This module allow to you render any string (specially html) using phantomJs.

Installation

$ npm install --save node-render

Usage

The new version used promises in instance of callbacks.

var nRender = require('node-render');

nRender.render(input, output, options);
nRender.renderToBuffer(input, options);
input = '<h1>Any string</<h1>'
options = null || myOptions // where myOptions is a object
output = '/path/to/my/output/file'
defaultOptions = {
    paperSize: {orientation: 'portrait', format: 'A4'},
    viewportSize: {width: 9921, height: 14031, margin: '0px'},
    onConsoleMessage: undefined,
    quality: 100,
    format: 'pdf', // if you are using renderToBuffer this is PNG
    root: '/'
  };

License

MIT © Alex Matos