Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

tempter

1.0.3 • Public • Published

Welcome to tempter 👋

Version

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"
}
Option Description Required
dir Says where our template should be coppied to true
type Determines 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.

Placeholder Replaced by Example
lowNAME Name from input, lowercased name
uppNAME Name from input, uppercased NAME
capNAME Name from input, capitalized Name

Author

👤 DEVICARUS

Install

npm i tempter

DownloadsWeekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

4.99 kB

Total Files

6

Last publish

Collaborators

  • avatar