https://github.com/juliangruber/node-pv
A node.js implementation of the pv utility
https://github.com/juliangruber/node-pv
Last synced: 8 months ago
JSON representation
A node.js implementation of the pv utility
- Host: GitHub
- URL: https://github.com/juliangruber/node-pv
- Owner: juliangruber
- Created: 2014-06-04T11:49:04.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-08-08T05:21:47.000Z (over 8 years ago)
- Last Synced: 2025-04-22T10:34:41.960Z (8 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 33
- Watchers: 2
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
- awesome_frontend_development_resources - pv - A node.js implementation of the Pipe Viewer utility, useful for inspecting a pipe's traffic. (Tools / React Components)
- awesome - pv - A node.js implementation of the Pipe Viewer utility, useful for inspecting a pipe's traffic. (Tools / React Components)
README
# node-pv
A node.js implementation of the
[Pipe Viewer](http://www.ivarch.com/programs/pv.shtml) utility, useful for
inspecting a pipe's traffic.
## Example
```bash
$ cat /dev/random | pv >/dev/null
18.88MB 00:00:02 [9.59MB/s]^C
```
## Usage
There's an excellent description on
[Peteris Krumins](https://github.com/pkrumins)'s blog:
[A Unix Utility You Should Know About: Pipe Viewer](http://www.catonmat.net/blog/unix-utilities-pipe-viewer/)
```bash
$ source | pv [OPTIONS] | dest
$ pv [OPTIONS] | dest
```
## Options
- `-s, --size SIZE`: Assume the total amount of data to be transferred is __SIZE__ bytes
- `-N, --name NAME`: Prefix the output information with __NAME__
## Installation
```bash
$ npm install -g node-pv
```
## JS API
```js
var PV = require('node-pv');
var pv = PV({
size: /* ... */,
name: /* ... */
});
pv.on('info', function(str){
process.stderr.write(str);
});
process.stdin.pipe(pv).pipe(process.stdout);
```
## License
MIT