angus-c / fusion-scaffolder

Scaffolds new projects from templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build status

fusion-scaffolder

Scaffolds new projects from templates.

Installation

Requires node 8.0.0 or above.

yarn add fusion-scaffolder

Usage

As an API:

import scaffold from 'fusion-scaffolder';

scaffold({
  path: 'path/to/template',
  project: 'project-name'
}).then(...).catch(...);

As a CLI:

Usage: fusion-scaffold <path-to-template> <project-name>

Options:

  -h, --help     Output usage information
  -v, --version  Output the version number

Template

The template from which a project is scaffolded MUST have a content/ folder and an index.js file at the root. The content/ folder will hold the template files that will be used in a newly scaffolded project. The index.js file will be called prior to scaffolding in order to gather required context/values to be passed to files that are compiled via nunjucks. Any .njk file in the content/ folder will be compiled with nunjucks, using values obtained via the scaffold CLI as well as the implementation of index.js, and the .njk extension will be removed upon scaffolding.

About

Scaffolds new projects from templates

License:MIT License


Languages

Language:JavaScript 96.1%Language:Shell 2.4%Language:Dockerfile 1.5%