copy-template-dir
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -34,5 +34,7 @@ const maxstache = require('maxstache-stream') | ||
const streams = [] | ||
const createdFiles = [] | ||
// create a new stream for every file emitted | ||
rs.on('data', function (file) { | ||
createdFiles.push(path.join(outDir, removeUnderscore(file.path))) | ||
streams.push(writeFile(outDir, vars, file)) | ||
@@ -44,3 +46,6 @@ }) | ||
if (err) return cb(err) | ||
parallel(streams, cb) | ||
parallel(streams, function (err) { | ||
if (err) return cb(err) | ||
cb(null, createdFiles) | ||
}) | ||
}) | ||
@@ -47,0 +52,0 @@ }) |
{ | ||
"name": "copy-template-dir", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "High throughput template dir writes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,4 +25,5 @@ # copy-template-dir | ||
copy(inDir, outDir, vars, (err) => { | ||
copy(inDir, outDir, vars, (err, createdFiles) => { | ||
if (err) throw err | ||
createdFiles.forEach(filePath => console.log(`Created ${filePath}`)) | ||
console.log('done!') | ||
@@ -41,3 +42,4 @@ }) | ||
- __vars__: An object with variables that are injected into the template files. | ||
- __cb(err)__: A callback that is called on completion. | ||
- __cb(err, createdFiles)__: A callback that is called on completion, with | ||
paths to created files if there were no errors. | ||
@@ -44,0 +46,0 @@ ## See Also |
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
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
6615
68
60