browser-pipe

0.3.0 • Public • Published

npm

browser-pipe

Build Status Dependency Status

Open URLs from stdin in the browser.

Usage

browser-pipe [--count=N] [--dry-run]

$ echo http://github.com | browser-pipe

browser-pipe forwards stdin to stdout, thus the original output is not modified:

$ ecstatic / | browser-pipe
ecstatic serving / at http://0.0.0.0:8000
--count=[-]N, -n[-]N

Open the first N links instead of all links. With the leading -, open the last N links.

$ curl "http://api.duckduckgo.com/?q=unicorn&format=xml&pretty=1" | browser-pipe -n2
--dry-run

Print URLs that would be opened, but do not open them.

API

browserPipe([opts])

Returns a writable stream.

Note: a single URL must not be split across multiple chunks of data in order to be recognized by this module. This is intentional. Open an issue if there is a legitimate use case where this property does not hold.

opts.count

Type: Number
Default: Infinity

If positive or zero, serves as the upper bound on the number of URLs to open.

If negative, gives the index of the first URL to print, counting from the end.

opts.open

Type: function(url)
Default: opn

URL opener.

Install

npm install browser-pipe

License

MIT

Package Sidebar

Install

npm i browser-pipe

Weekly Downloads

1

Version

0.3.0

License

MIT

Last publish

Collaborators

  • eush77