@parcel/fs-write-stream-atomic
Advanced tools
Comparing version 2.2.2-nightly.2609 to 2.2.2-nightly.2614
20
index.js
var fs = require('graceful-fs'); | ||
var Writable = require('readable-stream').Writable; | ||
var Writable = require('stream').Writable; | ||
var util = require('util'); | ||
@@ -67,3 +67,3 @@ var MurmurHash3 = require('imurmurhash'); | ||
// target stream is closed and we've moved everything around. | ||
WriteStreamAtomic.prototype.emit = function(event) { | ||
WriteStreamAtomic.prototype.emit = function (event) { | ||
if (event === 'finish') return this.__atomicStream.end(); | ||
@@ -73,3 +73,3 @@ return Writable.prototype.emit.apply(this, arguments); | ||
WriteStreamAtomic.prototype._write = function(buffer, encoding, cb) { | ||
WriteStreamAtomic.prototype._write = function (buffer, encoding, cb) { | ||
var flushed = this.__atomicStream.write(buffer, encoding); | ||
@@ -81,3 +81,3 @@ if (flushed) return cb(); | ||
function handleOpen(writeStream) { | ||
return function(fd) { | ||
return function (fd) { | ||
writeStream.emit('open', fd); | ||
@@ -88,3 +88,3 @@ }; | ||
function handleClose(writeStream) { | ||
return function() { | ||
return function () { | ||
if (writeStream.__atomicClosed) return; | ||
@@ -134,3 +134,3 @@ writeStream.__atomicClosed = true; | ||
fs.createReadStream(writeStream.__atomicTmp) | ||
.on('data', function(data, enc) { | ||
.on('data', function (data, enc) { | ||
tmpFileHash.update(data, enc); | ||
@@ -141,3 +141,3 @@ }) | ||
fs.createReadStream(writeStream.__atomicTarget) | ||
.on('data', function(data, enc) { | ||
.on('data', function (data, enc) { | ||
targetFileHash.update(data, enc); | ||
@@ -166,3 +166,3 @@ }) | ||
function cleanup(err) { | ||
fs.unlink(writeStream.__atomicTmp, function() { | ||
fs.unlink(writeStream.__atomicTmp, function () { | ||
if (err) { | ||
@@ -185,3 +185,3 @@ writeStream.emit('error', err); | ||
// after the async close operation completes. | ||
setImmediate(function() { | ||
setImmediate(function () { | ||
writeStream.emit('close'); | ||
@@ -193,3 +193,3 @@ }); | ||
function handleError(writeStream) { | ||
return function(er) { | ||
return function (er) { | ||
cleanupSync(); | ||
@@ -196,0 +196,0 @@ writeStream.emit('error', er); |
{ | ||
"name": "@parcel/fs-write-stream-atomic", | ||
"version": "2.2.2-nightly.2609+74fcc3fb", | ||
"version": "2.2.2-nightly.2614+c3a28caf", | ||
"description": "Like `fs.createWriteStream(...)`, but atomic.", | ||
@@ -24,8 +24,7 @@ "main": "index.js", | ||
"iferr": "^1.0.2", | ||
"imurmurhash": "^0.1.4", | ||
"readable-stream": "1 || 2" | ||
"imurmurhash": "^0.1.4" | ||
}, | ||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", | ||
"license": "ISC", | ||
"gitHead": "74fcc3fbe80cea993bff10e158df3d0f701973c7" | ||
"gitHead": "c3a28caf3dd7cd44a092b3d1361e8d1ac26e04ee" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
3
20230
- Removedreadable-stream@1 || 2
- Removedcore-util-is@1.0.3(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@1.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)