temject.copy
Copy the file while converting with temject
function | temject | temjectCopy |
---|---|---|
temject | ⭕ | ⭕ |
keyValueInjector | ⭕ | ⭕ |
dateTimeInjector | ⭕ | ⭕ |
expressions | ⭕ | ⭕ |
expressionFiles | ✘ | ⭕ |
temjectCopy | ✘ | ⭕ |
temjectCopyRecursive | ✘ | ⭕ |
API
expressionFiles(glob [,opts])
Param | Type | Default | Description |
---|---|---|---|
glob | Array | string |
paths or glob | |
[opts] | Object |
{} |
fast-glob |
await // -> ['foo','bar']
await
temjectCopy(srcPath, distPath, injections [, opts])
Param | Type | Default | Description |
---|---|---|---|
srcPath | string |
src file path | |
distPath | string |
dist file path | |
injections | Object |
inject key and value | |
[opts] | Object |
{} |
options |
[opts.plain] | boolean |
false |
Plain copy |
[opts.overwrite] | boolean |
false |
Force overwrite |
Example
// 'Hello, {{name:pascal}}!' > src.txtconst srcPath = 'src.txt'const distPath = 'dist.txt'await // dist.txt -> 'Hello, World!'
temjectCopyRecursive(srcDir, distDir, injections [, opts])
Param | Type | Default | Description |
---|---|---|---|
srcDir | string |
src file directory or glob | |
distDir | string |
dist directory path | |
injections | Object |
inject key and value | |
[opts] | Object |
{} |
options |
[opts.dry] | boolean |
false |
not copy |
[opts.plainCopy] | Array |
false |
not temject convert |
[opts.overwrite] | boolean |
false |
Force overwrite |
Example
await
await
Related
License
MIT © mick-whats