1. 程式人生 > >[Poi] Use Poi to Build an Index.js with Modern JavaScript Features

[Poi] Use Poi to Build an Index.js with Modern JavaScript Features

server com when eve serve javascrip port mman automatic

Poi can easily launch an index.js file simply by running the poi command. This will launch a dev-server and automatically reload whenever you make changes. You can also npm install any package you need and import it right away.

Install:

npm install -g poi

Code:

// src/index.js

import {Observable} from 
‘rxjs‘; Observable.intervable(1000).subscribe( i = > document.getElementById("app").innerHTML = ` <h1>{i}</h1> ` )

Run:

poi src/index --port 3000

[Poi] Use Poi to Build an Index.js with Modern JavaScript Features