Comparing version 0.1.0 to 0.1.1
49
index.js
@@ -157,2 +157,36 @@ 'use strict'; | ||
copy.onePromise = function copyOnePromise(fp, dest) { | ||
var deferred = Promise.defer(); | ||
var error = function (err) { | ||
deferred.reject(err); | ||
}; | ||
var cb = function (err) { | ||
deferred.resolve(err); | ||
}; | ||
mkdirPromise(fp, dest) | ||
.then(function () { | ||
}) | ||
// var rs = fs.createReadStream(fp); | ||
// rs.on("error", error); | ||
// var ws = fs.createWriteStream(dest); | ||
// ws.on("error", error); | ||
// ws.on("close", cb); | ||
// rs.pipe(ws); | ||
// return deferred.promise; | ||
}; | ||
// function (src, dest, cb) { | ||
// var copyPromise = copyDirs(src, dest); | ||
// if (!cb) return copyPromise; | ||
// copyPromise.then(cb); | ||
// } | ||
/** | ||
@@ -169,5 +203,17 @@ * Base function for copying files. | ||
src = path.resolve(opts.cwd, src); | ||
fs.createReadStream(src).pipe(fs.createWriteStream(dest)); | ||
var rs = fs.createReadStream(src); | ||
var ws = fs.createWriteStream(dest); | ||
rs.pipe(ws); | ||
}; | ||
function mkdirPromise(dir, opts) { | ||
return new Promise(function (resolve, reject) { | ||
mkdir(dir, opts, function (err, made) { | ||
if (err) return reject(err); | ||
return resolve(made); | ||
}); | ||
}); | ||
}; | ||
/** | ||
@@ -218,2 +264,3 @@ * Rewrite the destination file path. | ||
/** | ||
@@ -220,0 +267,0 @@ * Expose `copy` |
{ | ||
"name": "copy", | ||
"description": "Copy files or directories using globs.", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/jonschlinkert/copy", | ||
@@ -13,3 +13,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"recurse.js" | ||
], | ||
@@ -29,2 +30,3 @@ "main": "index.js", | ||
"graceful-fs": "^4.1.2", | ||
"lazy-cache": "^0.1.0", | ||
"lazy-globby": "^0.1.1", | ||
@@ -52,3 +54,18 @@ "mkdirp": "^0.5.1" | ||
"system" | ||
] | ||
} | ||
], | ||
"verb": { | ||
"related": { | ||
"list": [ | ||
"write", | ||
"write-yaml", | ||
"copy", | ||
"write-json", | ||
"read-data", | ||
"glob-fs", | ||
"micromatch", | ||
"delete", | ||
"export-files" | ||
] | ||
} | ||
} | ||
} |
@@ -5,2 +5,15 @@ # copy [![NPM version](https://badge.fury.io/js/copy.svg)](http://badge.fury.io/js/copy) | ||
**TODO** | ||
* [x] sync | ||
* [x] async | ||
* [x] dir | ||
* [x] dir sync | ||
* [x] one file | ||
* [x] one file sync | ||
* [ ] promise | ||
* [ ] stream | ||
* [ ] docs | ||
* [ ] tests | ||
## Install | ||
@@ -122,3 +135,3 @@ | ||
{%= related([]) %} | ||
{%= related(['write', 'read-data', 'read-yaml', 'export-files']) %} | ||
@@ -125,0 +138,0 @@ ## Running tests |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
14717
5
294
162
0
8
2
+ Addedlazy-cache@^0.1.0