You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

asset-pipe-sink-fs

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asset-pipe-sink-fs - npm Package Compare versions

Comparing version

to
1.0.0-alpha.4

17

lib/sink.js

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -11,5 +11,4 @@ const JSONStream = require('JSONStream');

const SinkFs = module.exports = function (fileDir) {
if (!(this instanceof SinkFs)) return new SinkFs(fileDir);
if (!(this instanceof SinkFs)) { return new SinkFs(fileDir); }
assert(fileDir, '"fileDir" must be provided');

@@ -21,3 +20,2 @@

SinkFs.prototype.writer = function (fileType, callback) {

@@ -28,8 +26,8 @@ const temp = path.join(this.fileDir, common.createTemporaryFilename(fileType));

const proxy = new stream.PassThrough();
const file = fs.createWriteStream(temp);
file.on('finish', () => {
const id = hasher.hash;
const fileName = id + '.' + fileType;
const fileName = `${id}.${fileType}`;
fs.rename(temp, path.join(this.fileDir, fileName), () => {

@@ -53,7 +51,6 @@ if (callback) {

SinkFs.prototype.reader = function (fileName, callback) {
const from = this.fileDir + fileName;
const file = fs.createReadStream(from);
SinkFs.prototype.reader = function (fileName, callback) {
let from = this.fileDir + fileName;
let file = fs.createReadStream(from);
file.on('finish', () => {

@@ -60,0 +57,0 @@ if (callback) {

{
"name": "asset-pipe-sink-fs",
"version": "1.0.0-alpha.3",
"version": "1.0.0-alpha.4",
"author": {

@@ -23,5 +23,2 @@ "name": "Trygve Lie",

],
"engines": {
"node" : "6.x"
},
"bugs": {

@@ -32,12 +29,18 @@ "url": "https://github.com/asset-pipe/asset-pipe-sink-fs/issues"

"dependencies": {
"JSONStream": "1.2.1",
"asset-pipe-common": "1.0.0-alpha.2",
"readable-stream": "2.2.2",
"JSONStream": "1.2.1"
"readable-stream": "2.2.2"
},
"devDependencies": {
"tap": "8.0.1"
"eslint": "^3.15.0",
"eslint-config-finn": "^1.0.1",
"tap": "10.0.2"
},
"scripts": {
"lint": "eslint .",
"test": "tap test/*.js"
}
},
"files": [
"lib"
]
}