@micburks/serve

1.0.4 • Public • Published

serve

Serve arbitrary script output

Usage

npx @micburks/serve script.js
// script.js
console.log(`
  <div>
    <h1>Hello world!</h1>
  </div>
`);

Using modules

serve requires Node 12 and runs your script equivalent to

node --experimental-modules --loader @micburks/jspm-loader script.js
// script.js
import fetch from 'https://dev.jspm.io/whatwg-fetch';
import greet from './greet.js';

(async () => {
  const data = await fetch('/user')
    .then(res => res.json());

  console.log(`
    <div>
      <h1>${greet(data.name)}</h1>
    </div>
  `);
})();

Readme

Keywords

none

Package Sidebar

Install

npm i @micburks/serve

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

3.33 kB

Total Files

6

Last publish

Collaborators

  • micburks