1.0.0 • Published 2 years ago
cpycnf v1.0.0
cpycnf
Define recurring file copy tasks in a config and execute them.
Usage
Global
npm install cpycnf --global$ cpycnfLocal
npm install cpycnf [--save-dev]$ npx cpycnfAdd to package.json
{
"name": "my-package",
"scripts": {
"copy": "cpycnf"
}
}Configuration
Add the cpycnf config to your package.json or a dedicated config file: .cpycnfrc.{json,js,cjs}, .config/cpycnfrc, .config/cpycnfrc.{json,js,cjs}, cpycnf.config.{js,cjs}
Example
One-to-one applicable to all .json config files.
{
"tasks": [
["node_modules/jquery/dist/jquery.min.*", "public/jquery"],
[
[
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.*",
"node_modules/bootstrap/dist/css/bootstrap.min.*"
], "public/bootstrap", { "flat": true }
]
]
}Every task in the tasks array consists of an array with a fixed structure:
type Task = [source: string | string[], destination: string, options: Options]Under the hood cpycnf uses cpy.
Head over to cpy#options for the options reference.
Example package.json
{
"name": "my-package",
// ...
"cpycnf": {
"tasks": [
// ...
]
}
}Example .js, .cjs
module.exports = {
tasks: [
// ...
]
}1.0.0
2 years ago