Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/fs-write-stream-atomic

Package Overview
Dependencies
Maintainers
1
Versions
398
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/fs-write-stream-atomic - npm Package Compare versions

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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc