All Projects → busterc → Microgen

busterc / Microgen

Licence: isc
♻️ micro-generator for individual files, easy like sunday morning 🌅

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Microgen

Pollinate
Template your base files and generate new projects from Git(Hub).
Stars: ✭ 213 (+150.59%)
Mutual labels:  generator, yeoman, scaffolding, templates
Yo
CLI tool for running Yeoman generators
Stars: ✭ 3,421 (+3924.71%)
Mutual labels:  generator, yeoman, scaffolding, templates
Sao
⚔ Futuristic scaffolding tool
Stars: ✭ 966 (+1036.47%)
Mutual labels:  generator, yeoman, scaffolding
Generator Modular Angular
A truly modular yeoman generator for AngularJS all device apps.
Stars: ✭ 23 (-72.94%)
Mutual labels:  generator, yeoman, scaffolding
Project Name
Get the name of a project from package.json, git config, or basename of the current working directory.
Stars: ✭ 8 (-90.59%)
Mutual labels:  generator, yeoman, scaffolding
Generate
A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.
Stars: ✭ 238 (+180%)
Mutual labels:  generator, yeoman, scaffolding
justgo
Skeleton for jump-starting a Go-powered microservice project with Docker and Go best-practices + easy code hot-reloading (for dev environments)!
Stars: ✭ 29 (-65.88%)
Mutual labels:  generator, templates, scaffolding
Assemble
Community
Stars: ✭ 3,995 (+4600%)
Mutual labels:  generator, templates
Generator Plugin Wp
Yeoman WordPress Plugin Generator
Stars: ✭ 270 (+217.65%)
Mutual labels:  generator, yeoman
Vim Colortemplate
The Toolkit for Vim Color Scheme Designers!
Stars: ✭ 535 (+529.41%)
Mutual labels:  generator, templates
Prompt Checkbox
This repository has been archived, use Enquirer instead.
Stars: ✭ 21 (-75.29%)
Mutual labels:  generator, yeoman
Generator Sails Rest Api
Yeoman generator for scaffolding Sails REST API with predefined features
Stars: ✭ 336 (+295.29%)
Mutual labels:  yeoman, scaffolding
nest-js-boilerplate
Nest.js boilerplate
Stars: ✭ 79 (-7.06%)
Mutual labels:  generator, yeoman
Generate Gh Repo
Generate generator to create a new repository on GitHub.
Stars: ✭ 11 (-87.06%)
Mutual labels:  generator, scaffolding
Larawiz
Larawiz is a easy project scaffolder for Laravel
Stars: ✭ 28 (-67.06%)
Mutual labels:  generator, scaffolding
Jmmasw
Just make me a static website
Stars: ✭ 13 (-84.71%)
Mutual labels:  generator, templates
Generator Angular Auto Admin Loopback
Generator for automatic CRUD angular backend for loopback apps and apis
Stars: ✭ 32 (-62.35%)
Mutual labels:  generator, yeoman
Relay Fullstack
☝️🏃 Modern Relay Starter Kit - Integrated with Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS
Stars: ✭ 986 (+1060%)
Mutual labels:  yeoman, scaffolding
reactcci
React create component interactive CLI
Stars: ✭ 49 (-42.35%)
Mutual labels:  generator, scaffolding
Generator Swiftserver
WARNING: This repository is no longer maintained
Stars: ✭ 64 (-24.71%)
Mutual labels:  generator, yeoman

microgen NPM version Build Status Dependency Status

micro-generator for individual files, easy like sunday morning

Yet another generator; how's it different?

  • any file, anywhere on disk can be a template
    • no need to install templates (like heavy weight project generators)
  • easiest way to fill in templates, using simple handlebars placeholders
  • no data files required (like other handlebars cli's)
    • you'll be prompted to fill in the data at runtime

Installation

$ npm install microgen # --global

Usage

$ microgen --help

  Usage: microgen <template-file> [output-file]

  Options:

    -h, --help      show usage help
    -p, --pipe      pipe output to stdout, instead of writing to file

    output-file     if not specified, it will be $PWD/<template-file>
                    * if <template-file> has an ".hbs" extension,
                      it will be removed from the output-file name

How does it work?

A microgen template is any file that can have handlebars placeholders. Microgen will scan the template for placeholders and prompt you to fill in a value for each one.

Supported placeholders:

  • Variable {{some-value}}
  • Block {{#some-boolean}}something{{else}}something else{{/some-boolean}}
    • {{^}} is the same as {{else}}
    • You can use string literals, e.g. {{#"Are you happy"}}great{{/"Are you happy"}}
  • Comment {{!some string to display when prompting}}
    • {{!--x--}} is the same as {{!x}}
    • {{!}} just adds a newline to the display

For example, say you have a package.json template file:

{{!
== Let the Good Times Roll ==
}}
{
  "name": "{{name}}",
  "repository": "{{owner}}/{{name}}",
  "description": "{{description}}",
{{!}}{{#"Include Dependencies"}}
  "dependencies": {
{{#assert-dotenv}}
    "assert-dotenv": "3.0.0",{{/assert-dotenv}}{{!}}{{#"Use a CLI Helper [meow, inquirer, commander]"}}{{#meow}}
    "meow": "^3.0.0",{{else}}{{#inquirer}}
    "inquirer": "^1.0.2",{{^}}{{#commander}}
    "commander": "^2.9.0",{{/commander}}{{/inquirer}}{{/meow}}{{/"Use a CLI Helper [meow, inquirer, commander]"}}
  }
{{/"Include Dependencies"}}
}

Microgen will prompt you like so:

== Let the Good Times Roll ==

name: smile
owner: busterc
description: writes :) to stdout

Include Dependencies (Y/n): y
  assert-dotenv (Y/n): y
  
  Use a CLI Helper [meow, inquirer, commander] (Y/n): y
    meow (Y/n): n
      inquirer (Y/n): n
        commander (Y/n): y

...and the resulting output file will contain:

{
  "name": "smile",
  "repository": "busterc/smile",
  "description": "writes :) to stdout",

  "dependencies": {
    "assert-dotenv": "3.0.0",
    "commander": "^2.9.0",
  }
}

Respect

microgen was inspired by khaos

If you need heavy weight project scaffolding generators, then look into plop and yo

License

ISC © Buster Collings

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].