1.0.0 • Published 4 years ago

canvas-to-dom-assets-generator v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

canvas-to-dom-assets-generator

Helper package for generating assets for canvas-to-dom in node.

Installation

$ npm install --save canvas-to-dom-assets-generator

Quick start

const assetsGenerator = require("canvas-to-dom-assets-generator");

assetsGenerator({
    "url": "http://localhost:3000",
    "selector": "canvas",
    "frame": "1",
    "outputDir": "/home/user/Desktop/"
})

Use with cli

assetsGenerator()

or

assetsGenerator({
    "cli": true
})
node example.js url=http://localhost:3000 frame=1 outputDir=/home/user/Desktop/

Examples

Use canvas id selector

assetsGenerator({
    "url": "http://localhost:3000",
    "selectorId": "app",
    "frame": "1",
    "outputDir": "/home/user/Desktop/",
    "outputFrameName": "frame1.png"
})

Use canvas class selector

assetsGenerator({
    "url": "http://localhost:3000",
    "selectorCls": "app",
    "frame": "1",
    "outputDir": "/home/user/Desktop/"
})

Use with default options

assetsGenerator({
    "url": "http://localhost:3000"
})

Default options:

  • selector: canvas
  • frame: 0
  • outputFrameName: screenshot.png
  • outputDir: current directory