Whip up a react component for quick standalone display.
npm install -g react-up
then run:
reactup path/to/component.js
--port: sets the http port (default: 8000)--css: path to a css file which will be used on the page. The file is also hot-loaded if any changes are made to it.
Eg.
reactup --port=5432 --css=theme.css path/to/component.js
var reactup = require('react-up');
reactup(filename, {
port: 1234,
css: './path/to.css',
setupBrowserify: function (b) {
// optional function where you can add custom transforms / plugins
}
}, cb);
Any changes made to the source component (or other modules require'd by the component) are live-reloaded in the page.
You can pipe in props from stdin like this:
cat props.json | reactup path/to/component.js
And if you have something that produces a stream of ndjson you will get realtime updates whenever the props change. Eg:
npm i -g watch-json
watch-json props.json | reactup path/to/component.js
Before sending to the browser we transform the component file with browserify and babelify so all of your jsx and es6 should work without a hitch (but please let me know if it doesn't!).
MIT
