component-preview

0.0.2 • Public • Published

component-preview

Preview a component in browser in a single command line

Usage

  Usage: component-preview [options] <script>

  Options:

    -h, --help              output usage information
    -V, --version           output the version number
    -d, --directory <path>  Component directory (default = '.')
    -p, --port <n>          Port to listen to (default = 3000)

The script argument is a javascript file. It contains the needed code to execute your component. For instance:

// Require your component with its name
var MyComponent = require('my-component');

console.log('I am executed on DOM.load event');

// Play with your component
var mycpn = new MyComponent();
document.body.appendChild(mycpn.el);

Readme

Keywords

Package Sidebar

Install

npm i component-preview

Weekly Downloads

2

Version

0.0.2

License

ISC

Last publish

Collaborators

  • dawicorti