copy-template-dir
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -1,2 +0,3 @@ | ||
const maxstache = require('maxstache-stream') | ||
const maxstacheStream = require('maxstache-stream') | ||
const maxstache = require('maxstache') | ||
const parallel = require('run-parallel') | ||
@@ -38,3 +39,3 @@ const eos = require('end-of-stream') | ||
rs.on('data', function (file) { | ||
createdFiles.push(path.join(outDir, removeUnderscore(file.path))) | ||
createdFiles.push(path.join(outDir, maxstache(removeUnderscore(file.path), vars))) | ||
streams.push(writeFile(outDir, vars, file)) | ||
@@ -61,3 +62,3 @@ }) | ||
const parentDir = file.parentDir | ||
const outFile = path.join(outDir, removeUnderscore(fileName)) | ||
const outFile = path.join(outDir, maxstache(removeUnderscore(fileName), vars)) | ||
@@ -68,3 +69,3 @@ mkdirp(path.join(outDir, parentDir), function (err) { | ||
const rs = fs.createReadStream(inFile) | ||
const ts = maxstache(vars) | ||
const ts = maxstacheStream(vars) | ||
const ws = fs.createWriteStream(outFile) | ||
@@ -71,0 +72,0 @@ |
{ | ||
"name": "copy-template-dir", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "High throughput template dir writes", | ||
@@ -23,2 +23,3 @@ "main": "index.js", | ||
"graceful-fs": "^4.1.3", | ||
"maxstache": "^1.0.0", | ||
"maxstache-stream": "^1.0.0", | ||
@@ -25,0 +26,0 @@ "mkdirp": "^0.5.1", |
@@ -38,5 +38,7 @@ # copy-template-dir | ||
with a `_` will have it removed when copying. Dotfiles need to be prepended | ||
with a `_`. Files are populated with variables using the `{{varName}}` syntax. | ||
with a `_`. Files and filenames are populated with variables using the | ||
`{{varName}}` syntax. | ||
- __targetDir__: the output directory | ||
- __vars__: An object with variables that are injected into the template files. | ||
- __vars__: An object with variables that are injected into the template files | ||
and file names. | ||
- __cb(err, createdFiles)__: A callback that is called on completion, with | ||
@@ -43,0 +45,0 @@ paths to created files if there were no errors. |
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
6798
69
62
9
1
+ Addedmaxstache@^1.0.0