Package Exports
- coz
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (coz) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
coz
Flexible generator, which makes your project clean and maintainable.
Table of Contents
About coz
What's this?
The basic idea of coz is that creating files from files.
- Writing a meta file called .bud file.
- Running
coz rendercommand will generate files.
What For?
Example Usages.
- Generate Javascript and Python code from database definition.
- Generate
package.jsonandbower.jsonsharing same meta data.
Why This?
Requirements
Installation
coz is available as an [NPM][npm_url] package.
$ npm install coz -gSpecifications
Bud file specification.
A bud contains file meta data like witch template to use, where to render it, what permission to give, and so on.
You can specify bud data by writing .bud file, which is actually a javascript file and could be written nodejs format.
module.exports = {
path: 'my_file.txt',
tmpl: '.my_file.txt.hbs',
data: require('./.my_data')
}And bud could be an array like:
module.exports = [
{path: 'my_file.txt', /*...*/},
{path: 'my_other_file.txt', /*...*/},
]Or an async function.
module.exports = function(callback){
myAsync(function(data){
var error = null;
callback(err, data);
});
}Supported properties
| Name | Type | Description |
|---|
engine | string|object | Template compile function or name of function | cwd | string | Working directory path | data | object | Data to template render with | mkdirp | boolean | Make parent directories if needed | setup | object | Properties to set engine | force | boolean | Should overwrite file when already exists, or not | mode | string|number | File permission | path | string | Destination file path. If not provided, guess from bud file path | tmpl | string|function | Template file path or registered template name or template function | Links
Tutorials
- 01 - Installing coz
- 02 - Rendering bud files
- 03 - Mastering coz bud
- 04 - Using programmatic API
- 05 - Customizing coz
Documents
Reports
License
This software is released under the MIT License.
About this project
Author
Donation
Support this project and others by okunishinishi via gratipay.
