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.5.1-nightly.2713 to 2.5.1-nightly.2714

18

index.js

@@ -67,3 +67,3 @@ var fs = require('graceful-fs');

// 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.5.1-nightly.2713+e68beeb5b",
"version": "2.5.1-nightly.2714+38bb2eefb",
"description": "Like `fs.createWriteStream(...)`, but atomic.",

@@ -28,3 +28,3 @@ "main": "index.js",

"license": "ISC",
"gitHead": "e68beeb5bbb4721a3bab306df8cb82f90cf3eb6a"
"gitHead": "38bb2eefbe74b469afb6d427a3c4cb85a6d6c9ed"
}
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