Comparing version 1.1.0 to 1.1.1
@@ -5,3 +5,3 @@ var fs = require("fs"), | ||
module.exports = function(filename, options, callback) { | ||
if (arguments.length < 2) callback = options, options = null; | ||
if (arguments.length < 3) callback = options, options = null; | ||
fs.stat(filename, function(error, stat) { | ||
@@ -13,3 +13,3 @@ if (error) return callback(error); | ||
var decoder = decode(options); | ||
fs.createReadStream(filename, options && {flags: options.flag || "r"}) // N.B. flag / flags | ||
fs.createReadStream(filename, options ? {flags: options.flag || "r"} : {}) // N.B. flag / flags | ||
.on("error", callback) | ||
@@ -16,0 +16,0 @@ .on("data", function(d) { decoder.push(d); }) |
@@ -5,3 +5,3 @@ var fs = require("fs"), | ||
module.exports = function(filename, data, options, callback) { | ||
if (arguments.length < 3) callback = options, options = null; | ||
if (arguments.length < 4) callback = options, options = null; | ||
fs.stat(filename, function(error, stat) { | ||
@@ -12,3 +12,3 @@ if (error && error.code !== "ENOENT") return callback(error); | ||
} else { | ||
fs.createWriteStream(filename, options && {flags: options.flag || "w"}) // N.B. flag / flags | ||
fs.createWriteStream(filename, options ? {flags: options.flag || "w"} : {}) // N.B. flag / flags | ||
.on("error", function(error) { callback(error.code === "EPIPE" ? null : error); }) // ignore broken pipe, e.g., | head | ||
@@ -15,0 +15,0 @@ .end(encode(data, options), callback); |
{ | ||
"name": "rw", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Now stdin and stdout are files.", | ||
@@ -24,4 +24,9 @@ "keywords": [ | ||
"scripts": { | ||
"test": "test/run-tests && eslint index.js lib" | ||
"test": "test/run-tests && eslint index.js lib", | ||
"prepublish": "npm test", | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git tag -am \"Release $VERSION.\" v${VERSION} && git push --tags" | ||
}, | ||
"devDependencies": { | ||
"d3-queue": "2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
22005
24
1