1.0.3 • Published 6 years ago

vue-img-renderer v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

vue-img-renderer

NPM library to convert vue to image it use combination of vueify and puppeteer to create image from vue template file

usage

  const vueImgRenderer = require('vue-img-renderer');

vueImgRenderer(jspath, outputpath, options)

  • jspath <string> javascipt of main vue element currently accepts only script that inject to #app
  • outputpath <string> path for the image eg. 'test.png'
  • option <object> options object
  • return <Promise> a promise

example

const vueImgRenderer = require('vue-img-renderer');

const path = require('path');
vueImgRenderer(path.resolve(__dirname, './TestD3/main.js'), 'test.png', {
    fileType: 'png',
    width: 500,
    height: 500
  }).then(() => {
    console.log("finished");
  }).catch((err) => {
    console.log(err);
  });