kpow

4.0.0 • Public • Published

about

A featureless JS-only pipe-to-browser utility like scat sans deps useful for running client side unit tests a-la testling for example. At core equivalent to:

printf 'HTTP/1.1 200 OK\r\n\n%s\n' "<script>console.log('coucou');</script>" | nc -c -l 1234

setup

Download from the npm registry:

# Add to package.json
npm install kpow --save-dev

usage

Fires up a transient server on a random port with the passed in file attached to an empty HTML page, then attempts to launch a browser prewiew using -c in one go.

Override the default open(1) command:

npx kpow -c xdg-open file.js

Be piping:

echo "alert('coucou')" | cat - file.js | npx kpow

Package Sidebar

Install

npm i kpow

Weekly Downloads

0

Version

4.0.0

License

Unlicense

Unpacked Size

6.24 MB

Total Files

4

Last publish

Collaborators

  • thewhodidthis