Socket
Socket
Sign inDemoInstall

fstream

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fstream - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

19

examples/filter-pipe.js

@@ -84,5 +84,5 @@ var fstream = require('../fstream.js')

console.error(indent + '%s %s for %d damage!',
entry.basename,
e ? 'is struck' : 'fires a chunk',
c.length)
entry.basename,
e ? 'is struck' : 'fires a chunk',
c.length)
}

@@ -95,4 +95,4 @@ }

console.error(indent + '%s %s',
entry.basename,
e ? 'turns to flee' : 'is vanquished!')
entry.basename,
e ? 'turns to flee' : 'is vanquished!')
indent = indent.slice(0, -1)

@@ -106,3 +106,3 @@ }

console.error(indent + '%s %s!', entry.basename,
entry.type === 'Directory' ? 'calls for backup' : 'attacks')
entry.type === 'Directory' ? 'calls for backup' : 'attacks')
entry.on('entry', attacks)

@@ -127,4 +127,4 @@ }

console.log((ok ? '' : 'not ') + 'ok ' + (i++) +
' should be a dir: ' +
e.path.substr(checker.path.length + 1))
' should be a dir: ' +
e.path.substr(checker.path.length + 1))
})

@@ -134,5 +134,6 @@ })

process.on('exit', function () {
console.log((ended ? '' : 'not ') + 'ok ' + (i++) + ' ended')
console.log((ended ? '' : 'not ') + 'ok ' + (i) + ' ended')
console.log('1..' + i)
})
r.pipe(w)

@@ -8,4 +8,4 @@ var fstream = require('../fstream.js')

return !this.basename.match(/^\./) &&
!this.basename.match(/^node_modules$/) &&
!this.basename.match(/^deep-copy$/)
!this.basename.match(/^node_modules$/) &&
!this.basename.match(/^deep-copy$/)
}

@@ -80,5 +80,5 @@ })

console.error(indent + '%s %s for %d damage!',
entry.basename,
e ? 'is struck' : 'fires a chunk',
c.length)
entry.basename,
e ? 'is struck' : 'fires a chunk',
c.length)
}

@@ -91,4 +91,4 @@ }

console.error(indent + '%s %s',
entry.basename,
e ? 'turns to flee' : 'is vanquished!')
entry.basename,
e ? 'turns to flee' : 'is vanquished!')
indent = indent.slice(0, -1)

@@ -102,3 +102,3 @@ }

console.error(indent + '%s %s!', entry.basename,
entry.type === 'Directory' ? 'calls for backup' : 'attacks')
entry.type === 'Directory' ? 'calls for backup' : 'attacks')
entry.on('entry', attacks)

@@ -119,4 +119,5 @@ }

console.log((ended ? '' : 'not ') + 'ok 2 ended')
console.log('1..2')
})
r.pipe(w)
var fstream = require('../fstream.js')
var notOpen = false
process.chdir(__dirname)

@@ -25,2 +26,3 @@ fstream

console.log((notOpen ? '' : 'not ') + 'ok 3 should be closed')
console.log('1..3')
})

@@ -35,18 +35,18 @@ // the parent class for all fstreams.

console.error('%s %s\n' +
'path = %s\n' +
'syscall = %s\n' +
'fstream_type = %s\n' +
'fstream_path = %s\n' +
'fstream_unc_path = %s\n' +
'fstream_class = %s\n' +
'fstream_stack =\n%s\n',
code || 'UNKNOWN',
er.stack,
er.path,
er.syscall,
er.fstream_type,
er.fstream_path,
er.fstream_unc_path,
er.fstream_class,
er.fstream_stack.join('\n'))
'path = %s\n' +
'syscall = %s\n' +
'fstream_type = %s\n' +
'fstream_path = %s\n' +
'fstream_unc_path = %s\n' +
'fstream_class = %s\n' +
'fstream_stack =\n%s\n',
code || 'UNKNOWN',
er.stack,
er.path,
er.syscall,
er.fstream_type,
er.fstream_path,
er.fstream_unc_path,
er.fstream_class,
er.fstream_stack.join('\n'))
} else {

@@ -53,0 +53,0 @@ self.emit('warn', er)

@@ -26,3 +26,3 @@ // It is expected that, when .add() returns false, the consumer

self.error('Non-directory type ' + props.type + ' ' +
JSON.stringify(props), null, true)
JSON.stringify(props), null, true)
}

@@ -106,3 +106,3 @@

if (pp === self.root._path || pp === self._path ||
(pp && pp.indexOf(self._path) === 0)) {
(pp && pp.indexOf(self._path) === 0)) {
// console.error('DW Exit (recursive)', entry.basename, self._path)

@@ -109,0 +109,0 @@ self._processing = false

@@ -24,3 +24,3 @@ // Basically just a wrapper around an fs.ReadStream

if (!((props.type === 'Link' && props.Link) ||
(props.type === 'File' && props.File))) {
(props.type === 'File' && props.File))) {
throw new Error('Non-file type ' + props.type)

@@ -67,4 +67,4 @@ }

self.error("Didn't get expected byte count\n" +
'expect: ' + self.props.size + '\n' +
'actual: ' + self._bytesEmitted)
'expect: ' + self.props.size + '\n' +
'actual: ' + self._bytesEmitted)
}

@@ -129,4 +129,4 @@ })

}
// console.error("FR _read done")
// that's about all there is to it.
// console.error("FR _read done")
// that's about all there is to it.
}

@@ -133,0 +133,0 @@

@@ -22,3 +22,3 @@ // Basically just a wrapper around an fs.readlink

if (!((props.type === 'Link' && props.Link) ||
(props.type === 'SymbolicLink' && props.SymbolicLink))) {
(props.type === 'SymbolicLink' && props.SymbolicLink))) {
throw new Error('Non-link type ' + props.type)

@@ -25,0 +25,0 @@ }

@@ -19,3 +19,3 @@ module.exports = LinkWriter

if (!((props.type === 'Link' && props.Link) ||
(props.type === 'SymbolicLink' && props.SymbolicLink))) {
(props.type === 'SymbolicLink' && props.SymbolicLink))) {
throw new Error('Non-link type ' + props.type)

@@ -70,4 +70,4 @@ }

if ((er.code === 'ENOENT' ||
er.code === 'EACCES' ||
er.code === 'EPERM') && process.platform === 'win32') {
er.code === 'EACCES' ||
er.code === 'EPERM') && process.platform === 'win32') {
self.ready = true

@@ -74,0 +74,0 @@ self.emit('ready')

@@ -57,9 +57,9 @@ module.exports = Reader

case 'Link':
// XXX hard links are just files.
// However, it would be good to keep track of files' dev+inode
// and nlink values, and create a HardLinkReader that emits
// a linkpath value of the original copy, so that the tar
// writer can preserve them.
// ClassType = HardLinkReader
// break
// XXX hard links are just files.
// However, it would be good to keep track of files' dev+inode
// and nlink values, and create a HardLinkReader that emits
// a linkpath value of the original copy, so that the tar
// writer can preserve them.
// ClassType = HardLinkReader
// break

@@ -107,3 +107,3 @@ case 'File':

self._path = '\\\\?\\' + self.path.replace(/\//g, '\\')
// }
// }
}

@@ -131,6 +131,6 @@ }

return a === b ? 0
: a.toLowerCase() > b.toLowerCase() ? 1
: a.toLowerCase() < b.toLowerCase() ? -1
: a > b ? 1
: -1
: a.toLowerCase() > b.toLowerCase() ? 1
: a.toLowerCase() < b.toLowerCase() ? -1
: a > b ? 1
: -1
}

@@ -137,0 +137,0 @@

@@ -116,3 +116,3 @@ module.exports = Writer

return self.warn('Cannot create ' + self._path + '\n' +
'Unsupported type: ' + self.type, 'ENOTSUP')
'Unsupported type: ' + self.type, 'ENOTSUP')
}

@@ -183,3 +183,3 @@ self._finish()

var chmod = want.follow || self.type !== 'SymbolicLink'
? 'chmod' : 'lchmod'
? 'chmod' : 'lchmod'

@@ -201,9 +201,9 @@ if (!fs[chmod]) return cb()

if (typeof want.uid !== 'number' &&
typeof want.gid !== 'number') return cb()
typeof want.gid !== 'number') return cb()
if (current.uid === want.uid &&
current.gid === want.gid) return cb()
current.gid === want.gid) return cb()
var chown = (self.props.follow || self.type !== 'SymbolicLink')
? 'chown' : 'lchown'
? 'chown' : 'lchown'
if (!fs[chown]) return cb()

@@ -221,3 +221,3 @@

var utimes = (want.follow || self.type !== 'SymbolicLink')
? 'utimes' : 'lutimes'
? 'utimes' : 'lutimes'

@@ -242,3 +242,3 @@ if (utimes === 'lutimes' && !fs[utimes]) {

if (meA.getTime() === curA.getTime() &&
meM.getTime() === curM.getTime()) return cb()
meM.getTime() === curM.getTime()) return cb()

@@ -282,4 +282,4 @@ fs[utimes](path, meA, meM, cb)

if (er.code === 'ENOENT' &&
(self.type === 'Link' || self.type === 'SymbolicLink') &&
process.platform === 'win32') {
(self.type === 'Link' || self.type === 'SymbolicLink') &&
process.platform === 'win32') {
self.ready = true

@@ -286,0 +286,0 @@ self.emit('ready')

@@ -5,3 +5,3 @@ {

"description": "Advanced file system stream things",
"version": "1.0.6",
"version": "1.0.7",
"repository": {

@@ -22,4 +22,4 @@ "type": "git",

"devDependencies": {
"tap": "0",
"standard": "^2.3.2"
"standard": "^4.0.0",
"tap": "^1.2.0"
},

@@ -26,0 +26,0 @@ "scripts": {

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