filefactory

1.0.5 • Public • Published

filefactory

generate files by the sample files

Installation

npm install -g filefactory

Example:

Goto the test folder and execute

ffy -c config.json

Usage

ffy --help
Usage: ffy ffy -s <sample> -d <delimiter> -t <target> -c <config>
 
Options:
 
    -h, --help              output usage information
    -V, --version           output the version number
    -s, --sample [type]     The sample file
    -d, --delimiter [type]  the template delimiter(optional), default is %
    -t, --target [type]     generate to this target path
    -c, --config [type]     the template's datasource, must be a .js or .json file

Config Options

module.exports = {
    //sample file or folder
    "sample": "./sample/",
    //Character to use with angle brackets for open/close
    "delimiter": "./delimiter",
    //File or folder name to generate files
    "dest": "./filefactory_dest",
    //filter could be a Function or RegeExp string
    //if filter return true filefactory will render file by ejs(a template engine) and data(configed in this file)
    "filter": "\\.(js|css|coffee|json|tpl|txt)",
    //the data file 
    "data": {
        "a": 1,
        "b": 2
    }
}

Related projects

Readme

Keywords

Package Sidebar

Install

npm i filefactory

Weekly Downloads

3

Version

1.0.5

License

https://github.com/lujintan/filefactory/blob/master/LICENSE

Last publish

Collaborators

  • yingxuetan