Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kcmr/nunjucks-scaffold-generator
Scaffold generator with Nunjucks
https://github.com/kcmr/nunjucks-scaffold-generator
generator node nunjucks nunjucks-templates scaffold templates
Last synced: 24 days ago
JSON representation
Scaffold generator with Nunjucks
- Host: GitHub
- URL: https://github.com/kcmr/nunjucks-scaffold-generator
- Owner: kcmr
- License: mit
- Created: 2018-05-04T22:23:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-04T23:34:54.000Z (over 6 years ago)
- Last Synced: 2024-12-14T22:46:21.660Z (27 days ago)
- Topics: generator, node, nunjucks, nunjucks-templates, scaffold, templates
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nunjucks Scaffold Generator
> Node tool to generate scaffolds using the Nunjucks template engine.
```
npm i -S nunjucks-scaffold-generator
```## Sample usage
```js
const {scaffold} = require('nunjucks-scaffold-generator');const templateParams = {
yourCustomVar: 'something',
yourCustomFunction: camelCase
};scaffold({
src: 'my/custom/templates',
dest: 'destiny/path',
replacement: ['my-template', 'new-name'],
params: templateParams
});
```The files in the folder specified in the `src` param will be copied into the location specified in `dest` param rendered by Nunjucks.
File names that dont't match the replacement pattern are preserved.## `scaffold()` params
| Param | Type | Description |
| :-- | :-- | :-- |
| `src` | String | Path to the source templates. |
| `dest` | String | Destiny for the generated scaffold. |
| `replacement` | Array | `['pattern', 'replacement']` Optional replacement for the filenames of the source templates. |
| `params` | Object | Params used by the Nunjucks templates. |