Comparing version 2.0.0 to 2.1.0
var path = require('path') | ||
, fs = require('fs') | ||
module.exports = function(file) { | ||
module.exports = function(file, stream) { | ||
stream = stream || process.stdout | ||
file = file | ||
@@ -13,3 +14,3 @@ ? file | ||
var rs = fs.createReadStream(file) | ||
rs.pipe(process.stdout) | ||
rs.pipe(stream) | ||
rs.on('close', function() { | ||
@@ -16,0 +17,0 @@ if (code) process.exit(code) |
{ | ||
"name": "help", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "substack way of --help", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,3 +23,3 @@ # help | ||
help(filepath) | ||
help(filepath, stream) | ||
@@ -32,2 +32,4 @@ returns function(code) | ||
`stream` defaults to `process.stdout` | ||
## Full example | ||
@@ -44,3 +46,3 @@ | ||
// the first arg must be a number | ||
if (isNan(args[0])) { | ||
if (isNaN(args[0])) { | ||
// process prints contents of `usage.txt` and exits with code 1 | ||
@@ -47,0 +49,0 @@ return help(1) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2885
17
57