Add production dependencies
This commit is contained in:
parent
5a0114f3e2
commit
579ccdc29f
12113 changed files with 978046 additions and 3 deletions
50
node_modules/fs-mkdirp-stream/index.js
generated
vendored
Normal file
50
node_modules/fs-mkdirp-stream/index.js
generated
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
'use strict';
|
||||
|
||||
var through = require('through2');
|
||||
|
||||
var mkdirp = require('./mkdirp');
|
||||
|
||||
function toFunction(dirpath) {
|
||||
function stringResolver(chunk, callback) {
|
||||
callback(null, dirpath);
|
||||
}
|
||||
|
||||
return stringResolver;
|
||||
}
|
||||
|
||||
function define(options) {
|
||||
|
||||
function mkdirpStream(resolver) {
|
||||
// Handle resolver that's just a dirpath
|
||||
if (typeof resolver === 'string') {
|
||||
resolver = toFunction(resolver);
|
||||
}
|
||||
|
||||
function makeFileDirs(chunk, enc, callback) {
|
||||
resolver(chunk, onDirpath);
|
||||
|
||||
function onDirpath(dirpathErr, dirpath, mode) {
|
||||
if (dirpathErr) {
|
||||
return callback(dirpathErr);
|
||||
}
|
||||
|
||||
mkdirp(dirpath, mode, onMkdirp);
|
||||
}
|
||||
|
||||
function onMkdirp(mkdirpErr) {
|
||||
if (mkdirpErr) {
|
||||
return callback(mkdirpErr);
|
||||
}
|
||||
|
||||
callback(null, chunk);
|
||||
}
|
||||
}
|
||||
|
||||
return through(options, makeFileDirs);
|
||||
}
|
||||
|
||||
return mkdirpStream;
|
||||
}
|
||||
|
||||
module.exports = define();
|
||||
module.exports.obj = define({ objectMode: true, highWaterMark: 16 });
|
Loading…
Add table
Add a link
Reference in a new issue