1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-12 02:42:48 +00:00

updated package.json

This commit is contained in:
2016-01-04 12:25:28 -05:00
parent 3443c97de4
commit 80ca24a715
1168 changed files with 73752 additions and 26424 deletions

4
node_modules/ncp/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,4 @@
node_modules
.*.sw[op]
.DS_Store
test/fixtures/out

7
node_modules/ncp/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,7 @@
language: node_js
node_js:
- 0.4
- 0.6
- 0.7
- 0.8

21
node_modules/ncp/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
# MIT License
###Copyright (C) 2011 by Charlie McConnell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

52
node_modules/ncp/README.md generated vendored Normal file
View File

@@ -0,0 +1,52 @@
# ncp - Asynchronous recursive file & directory copying
[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp)
Think `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI tool and programmatically.
## Command Line usage
Usage is simple: `ncp [source] [dest] [--limit=concurrency limit]
[--filter=filter] --stopOnErr`
The 'filter' is a Regular Expression - matched files will be copied.
The 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time.
'stopOnErr' is a boolean flag that will tell `ncp` to stop immediately if any
errors arise, rather than attempting to continue while logging errors.
If there are no errors, `ncp` will output `done.` when complete. If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue.
## Programmatic usage
Programmatic usage of `ncp` is just as simple. The only argument to the completion callback is a possible error.
```javascript
var ncp = require('ncp').ncp;
ncp.limit = 16;
ncp(source, destination, function (err) {
if (err) {
return console.error(err);
}
console.log('done!');
});
```
You can also call ncp like `ncp(source, destination, options, callback)`.
`options` should be a dictionary. Currently, such options are available:
* `options.filter` - a `RegExp` instance, against which each file name is
tested to determine whether to copy it or not, or a function taking single
parameter: copied file name, returning `true` or `false`, determining
whether to copy file or not.
* `options.transform` - a function: `function (read, write) { read.pipe(write) }`
used to apply streaming transforms while copying.
* `options.clobber` - boolean=true. if set to false, `ncp` will not overwrite
destination files that already exist.
Please open an issue if any bugs arise. As always, I accept (working) pull requests, and refunds are available at `/dev/null`.

48
node_modules/ncp/bin/ncp generated vendored Executable file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env node
var ncp = require('../lib/ncp'),
args = process.argv.slice(2),
source, dest;
if (args.length < 2) {
console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]');
process.exit(1);
}
// parse arguments the hard way
function startsWith(str, prefix) {
return str.substr(0, prefix.length) == prefix;
}
var options = {};
args.forEach(function (arg) {
if (startsWith(arg, "--limit=")) {
options.limit = parseInt(arg.split('=', 2)[1], 10);
}
if (startsWith(arg, "--filter=")) {
options.filter = new RegExp(arg.split('=', 2)[1]);
}
if (startsWith(arg, "--stoponerr")) {
options.stopOnErr = true;
}
});
ncp.ncp(args[0], args[1], options, function (err) {
if (Array.isArray(err)) {
console.error('There were errors during the copy.');
err.forEach(function (err) {
console.error(err.stack || err.message);
});
process.exit(1);
}
else if (err) {
console.error('An error has occurred.');
console.error(err.stack || err.message);
process.exit(1);
}
});

222
node_modules/ncp/lib/ncp.js generated vendored Normal file
View File

@@ -0,0 +1,222 @@
var fs = require('fs'),
path = require('path');
module.exports = ncp
ncp.ncp = ncp
function ncp (source, dest, options, callback) {
if (!callback) {
callback = options;
options = {};
}
var basePath = process.cwd(),
currentPath = path.resolve(basePath, source),
targetPath = path.resolve(basePath, dest),
filter = options.filter,
transform = options.transform,
clobber = options.clobber !== false,
errs = null,
started = 0,
finished = 0,
running = 0,
limit = options.limit || ncp.limit || 16;
limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit;
startCopy(currentPath);
function startCopy(source) {
started++;
if (filter) {
if (filter instanceof RegExp) {
if (!filter.test(source)) {
return cb(true);
}
}
else if (typeof filter === 'function') {
if (!filter(source)) {
return cb(true);
}
}
}
return getStats(source);
}
function defer(fn) {
if (typeof(setImmediate) === 'function')
return setImmediate(fn);
return process.nextTick(fn);
}
function getStats(source) {
if (running >= limit) {
return defer(function () {
getStats(source);
});
}
running++;
fs.lstat(source, function (err, stats) {
var item = {};
if (err) {
return onError(err);
}
// We need to get the mode from the stats object and preserve it.
item.name = source;
item.mode = stats.mode;
if (stats.isDirectory()) {
return onDir(item);
}
else if (stats.isFile()) {
return onFile(item);
}
else if (stats.isSymbolicLink()) {
// Symlinks don't really need to know about the mode.
return onLink(source);
}
});
}
function onFile(file) {
var target = file.name.replace(currentPath, targetPath);
isWritable(target, function (writable) {
if (writable) {
return copyFile(file, target);
}
if(clobber)
rmFile(target, function () {
copyFile(file, target);
});
});
}
function copyFile(file, target) {
var readStream = fs.createReadStream(file.name),
writeStream = fs.createWriteStream(target, { mode: file.mode });
if(transform) {
transform(readStream, writeStream,file);
} else {
readStream.pipe(writeStream);
}
readStream.once('end', cb);
}
function rmFile(file, done) {
fs.unlink(file, function (err) {
if (err) {
return onError(err);
}
return done();
});
}
function onDir(dir) {
var target = dir.name.replace(currentPath, targetPath);
isWritable(target, function (writable) {
if (writable) {
return mkDir(dir, target);
}
copyDir(dir.name);
});
}
function mkDir(dir, target) {
fs.mkdir(target, dir.mode, function (err) {
if (err) {
return onError(err);
}
copyDir(dir.name);
});
}
function copyDir(dir) {
fs.readdir(dir, function (err, items) {
if (err) {
return onError(err);
}
items.forEach(function (item) {
startCopy(dir + '/' + item);
});
return cb();
});
}
function onLink(link) {
var target = link.replace(currentPath, targetPath);
fs.readlink(link, function (err, resolvedPath) {
if (err) {
return onError(err);
}
checkLink(resolvedPath, target);
});
}
function checkLink(resolvedPath, target) {
isWritable(target, function (writable) {
if (writable) {
return makeLink(resolvedPath, target);
}
fs.readlink(target, function (err, targetDest) {
if (err) {
return onError(err);
}
if (targetDest === resolvedPath) {
return cb();
}
return rmFile(target, function () {
makeLink(resolvedPath, target);
});
});
});
}
function makeLink(linkPath, target) {
fs.symlink(linkPath, target, function (err) {
if (err) {
return onError(err);
}
return cb();
});
}
function isWritable(path, done) {
fs.lstat(path, function (err, stats) {
if (err) {
if (err.code === 'ENOENT') return done(true);
return done(false);
}
return done(false);
});
}
function onError(err) {
if (options.stopOnError) {
return callback(err);
}
else if (!errs && options.errs) {
errs = fs.createWriteStream(options.errs);
}
else if (!errs) {
errs = [];
}
if (typeof errs.write === 'undefined') {
errs.push(err);
}
else {
errs.write(err.stack + '\n\n');
}
return cb();
}
function cb(skipped) {
if (!skipped) running--;
finished++;
if ((started === finished) && (running === 0)) {
return errs ? callback(errs) : callback(null);
}
}
};

84
node_modules/ncp/package.json generated vendored Normal file
View File

@@ -0,0 +1,84 @@
{
"_args": [
[
"ncp@0.4.x",
"/home/mywebsite/node_modules/utile"
]
],
"_from": "ncp@>=0.4.0 <0.5.0",
"_id": "ncp@0.4.2",
"_inCache": true,
"_installable": true,
"_location": "/ncp",
"_npmUser": {
"email": "charlie@charlieistheman.com",
"name": "avianflu"
},
"_npmVersion": "1.2.2",
"_phantomChildren": {},
"_requested": {
"name": "ncp",
"raw": "ncp@0.4.x",
"rawSpec": "0.4.x",
"scope": null,
"spec": ">=0.4.0 <0.5.0",
"type": "range"
},
"_requiredBy": [
"/utile"
],
"_resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz",
"_shasum": "abcc6cbd3ec2ed2a729ff6e7c1fa8f01784a8574",
"_shrinkwrap": null,
"_spec": "ncp@0.4.x",
"_where": "/home/mywebsite/node_modules/utile",
"author": {
"email": "charlie@charlieistheman.com",
"name": "AvianFlu"
},
"bin": {
"ncp": "./bin/ncp"
},
"bugs": {
"url": "https://github.com/AvianFlu/ncp/issues"
},
"dependencies": {},
"description": "Asynchronous recursive file copy utility.",
"devDependencies": {
"read-dir-files": "0.0.x",
"rimraf": "1.0.x",
"vows": "0.6.x"
},
"directories": {},
"dist": {
"shasum": "abcc6cbd3ec2ed2a729ff6e7c1fa8f01784a8574",
"tarball": "http://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz"
},
"engine": {
"node": ">=0.4"
},
"homepage": "https://github.com/AvianFlu/ncp#readme",
"keywords": [
"cli",
"copy"
],
"license": "MIT",
"main": "./lib/ncp.js",
"maintainers": [
{
"name": "avianflu",
"email": "charlie@charlieistheman.com"
}
],
"name": "ncp",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/AvianFlu/ncp.git"
},
"scripts": {
"test": "vows --isolate --spec"
},
"version": "0.4.2"
}

1
node_modules/ncp/test/fixtures/src/a generated vendored Normal file
View File

@@ -0,0 +1 @@
Hello world

1
node_modules/ncp/test/fixtures/src/b generated vendored Normal file
View File

@@ -0,0 +1 @@
Hello ncp

0
node_modules/ncp/test/fixtures/src/c generated vendored Normal file
View File

0
node_modules/ncp/test/fixtures/src/d generated vendored Normal file
View File

0
node_modules/ncp/test/fixtures/src/e generated vendored Normal file
View File

0
node_modules/ncp/test/fixtures/src/f generated vendored Normal file
View File

1
node_modules/ncp/test/fixtures/src/sub/a generated vendored Normal file
View File

@@ -0,0 +1 @@
Hello nodejitsu

0
node_modules/ncp/test/fixtures/src/sub/b generated vendored Normal file
View File

86
node_modules/ncp/test/ncp-test.js generated vendored Normal file
View File

@@ -0,0 +1,86 @@
var assert = require('assert'),
path = require('path'),
rimraf = require('rimraf'),
vows = require('vows'),
readDirFiles = require('read-dir-files'),
ncp = require('../').ncp;
var fixtures = path.join(__dirname, 'fixtures'),
src = path.join(fixtures, 'src'),
out = path.join(fixtures, 'out');
vows.describe('ncp').addBatch({
'When copying a directory of files': {
topic: function () {
var cb = this.callback;
rimraf(out, function () {
ncp(src, out, cb);
});
},
'files should be copied': {
topic: function () {
var cb = this.callback;
readDirFiles(src, 'utf8', function (srcErr, srcFiles) {
readDirFiles(out, 'utf8', function (outErr, outFiles) {
cb(outErr, srcFiles, outFiles);
});
});
},
'and the destination should match the source': function (err, srcFiles, outFiles) {
assert.isNull(err);
assert.deepEqual(srcFiles, outFiles);
}
}
}
}).addBatch({
'When copying files using filter': {
topic: function() {
var cb = this.callback;
var filter = function(name) {
return name.substr(name.length - 1) != 'a'
}
rimraf(out, function () {
ncp(src, out, {filter: filter}, cb);
});
},
'it should copy files': {
topic: function () {
var cb = this.callback;
readDirFiles(src, 'utf8', function (srcErr, srcFiles) {
function filter(files) {
for (var fileName in files) {
var curFile = files[fileName];
if (curFile instanceof Object)
return filter(curFile);
if (fileName.substr(fileName.length - 1) == 'a')
delete files[fileName];
}
}
filter(srcFiles);
readDirFiles(out, 'utf8', function (outErr, outFiles) {
cb(outErr, srcFiles, outFiles);
});
});
},
'and destination files should match source files that pass filter': function (err, srcFiles, outFiles) {
assert.isNull(err);
assert.deepEqual(srcFiles, outFiles);
}
}
}
}).addBatch({
'When copying files using transform': {
'it should pass file descriptors along to transform functions': function() {
ncp(src, out, {
transform: function(read,write,file) {
assert.notEqual(file.name, undefined);
assert.strictEqual(typeof file.mode,'number');
read.pipe(write);
}
}, function(){});
}
}
}).export(module);