file-gen-cli
A CLI that generate files for your application
Last updated a year ago by guignol .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install file-gen-cli 
SYNC missed versions from official npm registry.

Build Status CodeFactor npm version BCH compliance tested with jest License: MIT

file-gen-cli

A CLI that generate files for your application

Installation

  • Install with

    npm install file-gen-cli --save-dev

  • Add a folder to hold your files templates

    files templates examples here

  • Add a gencli.json file at the root of your project

    gencli.json example here

  • Add this script in your package.json

    "file-gen-cli": "./node_modules/.bin/file-gen-cli"

  • Run with

    npm run file-gen-cli

Documentation (gencli.json)

General config

Param definition default required possible values
fileNameCase the case of the files name kebab false kebab, camel, pascal, constant, snake
folderNameCase the case of the folders name kebab false kebab, camel, pascal, constant, snake
templatePath the path to the files template (from project root), the path will be normalized true
entityConfigs an array of entity configs true

Entity config

Param definition default required possible values
name the entity name true
path the path where to create the entity instances (from project root), the path will be normalized true
prefix the entity prefix that can occur in different files template false
fileConfigs an array of file configs true

File config

Param definition default required possible values
name the file name (the * symbole is replaced by the entity instance name) true
template the template name for the file (no template will generate an empty file) false

Templates

keyword replaced with
{{SINGULAR_PASCAL}} instance name pascal case
{{SINGULAR_CAMEL}} instance name camel case
{{SINGULAR_CONSTANT}} instance name constant case
{{SINGULAR_KEBAB}} instance name kebab case
{{SINGULAR_SNAKE}} instance name kebab case
{{PLURAL_PASCAL}} instance plural name pascal case
{{PLURAL_CAMEL}} instance plural name came case
{{PLURAL_CONSTANT}} instance plural name constant case
{{PLURAL_KEBAB}} instance plural name kebab case
{{PLURAL_SNAKE}} instance plural name kebab case
{{PREFIXED_SINGULAR_PASCAL}} instance prefixed name pascal case
{{PREFIXED_SINGULAR_CAMEL}} instance prefixed name camel case
{{PREFIXED_SINGULAR_CONSTANT}} instance prefixed name constant case
{{PREFIXED_SINGULAR_KEBAB}} instance prefixed name kebab case
{{PREFIXED_SINGULAR_SNAKE}} instance prefixed name kebab case
{{PREFIXED_PLURAL_PASCAL}} instance prefixed plural name pascal case
{{PREFIXED_PLURAL_CAMEL}} instance prefixed plural name camel case
{{PREFIXED_PLURAL_CONSTANT}} instance prefixed plural name constant case
{{PREFIXED_PLURAL_KEBAB}} instance prefixed plural name kebab case
{{PREFIXED_PLURAL_SNAKE}} instance prefixed plural name kebab case

TODO

  • support nested folders

Contributing

  • Feel free to suggest features, submit issues or update the documentation!

License

  • Copyright (c) 2019 Vincent Guillemette (github: guignol1981) Licensed under the MIT license.

Current Tags

  • 1.2.3                                ...           latest (a year ago)

13 Versions

  • 1.2.3                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 26
Last Day 0
Last Week 26
Last Month 0
Dependencies (4)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |