https://github.com/kessler/node-hcat
pipe html into your browser from command line
https://github.com/kessler/node-hcat
javascript nodejs
Last synced: about 2 months ago
JSON representation
pipe html into your browser from command line
- Host: GitHub
- URL: https://github.com/kessler/node-hcat
- Owner: kessler
- License: mit
- Created: 2014-04-20T01:48:43.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-05-13T20:39:49.000Z (almost 3 years ago)
- Last Synced: 2025-03-08T08:12:40.385Z (about 2 months ago)
- Topics: javascript, nodejs
- Language: JavaScript
- Size: 28.3 KB
- Stars: 49
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hcat
Pipe html into your browser from command lineYou should take a look at [scat](https://github.com/hughsk/scat) which pipes javascript into your browser or [bcat](https://github.com/kessler/node-bcat) for a more log piping oriented module
## CLI tool
```
npm install -g hcat
echo '
' | hcat
```### command line parameters
```
--port set a port for this hcat execution, defaults to 0 (random port)
--hostname set the hostname for this hcat execution, defaults to localhost
--contentType set the content type header for this hcat execution, defaults to text/html
```## API
```
npm install --save hcat
``````js
const hcat = require('hcat')
const fs = require('fs')// config is optional
hcat(fs.createReadStream('foo.html'), { port: 8080 })// string or buffer instead of stream
hcat('test 123
', { port: 8080 })
```Many thanks to all the contributors