Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update fstream

  • Loading branch information...
commit 530114db7809150cf67828683cb2bb5f6d87a07f 1 parent 9d99897
@isaacs isaacs authored
View
4 node_modules/fstream/.npmignore
@@ -1,3 +1,5 @@
.*.swp
-examples/deep-copy
node_modules/
+examples/deep-copy/
+examples/path/
+examples/filter-copy/
View
25 node_modules/fstream/LICENCE
@@ -0,0 +1,25 @@
+Copyright (c) Isaac Z. Schlueter
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
View
3  node_modules/fstream/lib/dir-writer.js
@@ -123,6 +123,9 @@ DirWriter.prototype._process = function () {
// get rid of any ../../ shenanigans
props.path = path.join(me.path, path.join("/", p))
+ // if i have a filter, the child should inherit it.
+ props.filter = me.filter
+
// all the rest of the stuff, copy over from the source.
Object.keys(entry.props).forEach(function (k) {
if (!props.hasOwnProperty(k)) {
View
3  node_modules/fstream/lib/proxy-reader.js
@@ -59,6 +59,9 @@ ProxyReader.prototype._addProxy = function (proxy) {
, "close"
, "linkpath"
, "entry"
+ , "entryEnd"
+ , "child"
+ , "childEnd"
, "warn"
].forEach(function (ev) {
// console.error("~~ proxy event", ev, me.path)
View
9 node_modules/fstream/lib/writer.js
@@ -98,6 +98,8 @@ function Writer (props, current) {
me._buffer = []
me.ready = false
+ me.filter = typeof props.filter === "function" ? props.filter: null
+
// start the ball rolling.
// this checks what's there already, and then calls
// me._create() to call the impl-specific creation stuff.
@@ -126,6 +128,13 @@ Writer.prototype._stat = function (current) {
else fs[stat](me._path, statCb)
function statCb (er, current) {
+ if (me.filter && !me.filter.call(me._proxy || me, current)) {
+ me._aborted = true
+ me.emit("end")
+ me.emit("close")
+ return
+ }
+
// if it's not there, great. We'll just create it.
// if it is there, then we'll need to change whatever differs
if (er || !current) {
View
15 node_modules/fstream/package.json
@@ -6,14 +6,14 @@
},
"name": "fstream",
"description": "Advanced file system stream things",
- "version": "0.1.13",
+ "version": "0.1.14",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream.git"
},
"main": "fstream.js",
"engines": {
- "node": "0.5 || 0.6 || 0.7"
+ "node": ">=0.6"
},
"dependencies": {
"rimraf": "2",
@@ -22,20 +22,21 @@
"inherits": "~1.0.0"
},
"devDependencies": {
- "tap": "0.1"
+ "tap": ""
},
"scripts": {
"test": "tap examples/*.js"
},
+ "license": "BSD",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
- "_id": "fstream@0.1.13",
+ "_id": "fstream@0.1.14",
"optionalDependencies": {},
"_engineSupported": true,
- "_npmVersion": "1.1.4",
- "_nodeVersion": "v0.7.6-pre",
+ "_npmVersion": "1.1.10",
+ "_nodeVersion": "v0.7.7-pre",
"_defaultsLoaded": true,
- "_from": "fstream@~0.1.5"
+ "_from": "fstream@~0.1.13"
}
Please sign in to comment.
Something went wrong with that request. Please try again.