React component to PNG converter
JavaScript
Latest commit d72c48b Nov 29, 2016 @jxnblk Update readme
Permalink
Failed to load latest commit information.
bin Support use as a node module Nov 8, 2016
example America Nov 8, 2016
README.md Update readme Nov 28, 2016
dev-server.js Add support for json Nov 15, 2016
index.js Support use as a node module Nov 8, 2016
package.json Add support for json Nov 15, 2016

README.md

repng

React component to PNG converter

npm i -g repng
repng Icon.js --width 512 --height 512 --out-dir assets
  Usage
    $ repng <Root-component>

  Options
    -c --css        CSS file to include

    -p --props      Props to pass to the React component

    -w --width      Width of image

    -h --height     Height of image

    --crop          Crop image to specified height

    -s --scale      Scale image

    -d --delay      Delay in seconds before rendering image

    -o --out-dir    Directory to save file to

    -f --filename   Name for rendered image

    -D --dev        Runs a webpack dev server

Development mode

To preview the component in a dev server, run repng with the --dev flag and open http://localhost:8080

repng Icon.js --dev

Running the dev mode might require that you have both webpack and webpack-dev-server installed locally

npm i -D webpack webpack-dev-server

Node.js Usage

Repng can also be used as a node module.

const repng = require('repng')
const Component = require('./Component')

const options = {
  props: {
    title: 'hello'
  }
}

const result = repng(Comp, options)

result.then(streams => {
  console.log('rendered component')
})

MIT License