1.0.3 ā€¢ Published 5 years ago

tempter v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Your own sub-generator. In minutes. Bundled with your project.

Features

Usage

1. Add tempter to your dev dependencies

yarn add -D tempter
# OR
npm install -dev tempter

Q: Why not CLI?\ A: You can bundle it with your boilerplate this way!

2. Create your generator file (e.g. generator.js)

// generator.js contents
require('tempter')('your/template/directory')

3. Add your templates to this directory

4. Done! You can now use your generator!

node generator.js

Tip: You may also add it to your npm scripts!

Docs

How to create a template

1. Create a folder (e.g. React Component) for your template in your template directory (e.g. templates)

2. Create a config file template.json for your template

Documentation

3. Add files

Just add template files in the same directory as template.json.

Placeholder documentation

Template configuration

{
  "dir": "src/components",
  "type": "subfolder"
}
OptionDescriptionRequired
dirSays where our template should be coppied totrue
typeDetermines if the template should be placed in a subfolder ("subfolder"), or just spread in dir ("spread")true

Placeholders

Placeholders may be used in both filenames and the actual templates, they will be replaced by the generator.

PlaceholderReplaced byExample
lowNAMEName from input, lowercasedname
uppNAMEName from input, uppercasedNAME
capNAMEName from input, capitalizedName

Author

šŸ‘¤ DEVICARUS