Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

copy

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

copy - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

recurse.js

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

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