Comparing version 1.3.1 to 2.0.0
@@ -0,1 +1,9 @@ | ||
2.0.0 / 2017-06-23 | ||
------------------ | ||
### Changed | ||
- `graceful-fs` is now a regular dependency, and is always loaded. This should speed up `require` time | ||
- Dropped support for Node 0.10 & 0.12 and io.js | ||
1.3.1 / 2016-10-25 | ||
@@ -2,0 +10,0 @@ ------------------ |
{ | ||
"name": "klaw", | ||
"version": "1.3.1", | ||
"version": "2.0.0", | ||
"description": "File system walker with Readable stream interface.", | ||
@@ -29,13 +29,12 @@ "main": "./src/index.js", | ||
"homepage": "https://github.com/jprichardson/node-klaw#readme", | ||
"dependencies": { | ||
"graceful-fs": "^4.1.9" | ||
}, | ||
"devDependencies": { | ||
"mkdirp": "^0.5.1", | ||
"mock-fs": "^3.8.0", | ||
"rimraf": "^2.4.3", | ||
"standard": "^8.4.0", | ||
"standard": "^10.0.2", | ||
"tap-spec": "^4.1.1", | ||
"tape": "^4.2.2" | ||
}, | ||
"optionalDependencies": { | ||
"graceful-fs": "^4.1.9" | ||
} | ||
} |
Node.js - klaw | ||
============== | ||
<a href="https://standardjs.com" style="float: right; padding: 0 0 20px 20px;"><img src="https://cdn.rawgit.com/feross/standard/master/sticker.svg" alt="JavaScript Standard Style" width="100" align="right"></a> | ||
A Node.js file system walker extracted from [fs-extra](https://github.com/jprichardson/node-fs-extra). | ||
@@ -10,5 +12,2 @@ | ||
<!-- [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) --> | ||
<a href="http://standardjs.com"><img src="https://cdn.rawgit.com/feross/standard/master/sticker.svg" alt="Standard" width="100"></a> | ||
Install | ||
@@ -19,3 +18,7 @@ ------- | ||
If you're using Typescript, we've got [types](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11492/files): | ||
npm i --save-dev @types/klaw | ||
Name | ||
@@ -27,2 +30,8 @@ ---- | ||
Sync | ||
---- | ||
If you need the same functionality but synchronous, you can use [klaw-sync](https://github.com/manidlou/node-klaw-sync). | ||
Usage | ||
@@ -79,6 +88,2 @@ ----- | ||
If you're not sure of the differences on Node.js streams 1, 2, 3 then I'd | ||
recommend this resource as a good starting point: https://strongloop.com/strongblog/whats-new-io-js-beta-streams3/. | ||
### Error Handling | ||
@@ -160,3 +165,3 @@ | ||
}) | ||
``` | ||
@@ -203,3 +208,3 @@ | ||
item.deleted = true | ||
fs.unklink(item.path, next) | ||
fs.unlink(item.path, next) | ||
} else { | ||
@@ -206,0 +211,0 @@ item.deleted = false |
var assert = require('assert') | ||
var fs | ||
try { | ||
fs = require('graceful-fs') | ||
} catch (e) { | ||
fs = require('fs') | ||
} | ||
var path = require('path') | ||
var Readable = require('stream').Readable | ||
var util = require('util') | ||
var assign = require('./assign') | ||
@@ -17,3 +10,3 @@ function Walker (dir, options) { | ||
var defaultOpts = { queueMethod: 'shift', pathSorter: undefined, filter: undefined } | ||
options = assign(defaultOpts, options, defaultStreamOptions) | ||
options = Object.assign(defaultOpts, options, defaultStreamOptions) | ||
@@ -24,3 +17,3 @@ Readable.call(this, options) | ||
this.options = options | ||
this.fs = options.fs || fs // mock-fs | ||
this.fs = options.fs || require('graceful-fs') | ||
} | ||
@@ -27,0 +20,0 @@ util.inherits(Walker, Readable) |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a 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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
5
276
0
12248
6
41
1
+ Addedgraceful-fs@^4.1.9