0.0.1 • Published 12 years ago
component-generate v0.0.1
component-generate 
Create a file based on a template and add it to component.json.
Install
npm install -g component-generateUsage
$ component generate foo.jsIt creates the file foo.js based on the JavaScript default template. It also add the reference to the component.json file.
{
...
"scripts": [
"foo.js"
]
}Options
Template
-t or --template
You can specify the template you want to use. The templates list is available here.
$ component generate index.js -t templateNameIf you want to add a new template, you can add it in template/[extension]/[templateName].tpl and make a PR. Templates are rendered using underscore.
In a future version, we will be able to use local templates. We need to find the simplest way to do it (see issue).
Parameters
-p or --params
Parameters that will be used by the template.
$ component generate index.js -t exports -p name:HomePageWill render
'use strict';
module.exports = HomePage;
function HomePage() {
}License
Released under the MIT license