# maker

> Generates files from various templates and inputs

Latest version **0.1.11** (published 2014-04-05) · 0 weekly downloads

## Install

```sh
npm install maker
pnpm add maker
yarn add maker
bun add maker
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2014-04-05 |
| First published | 2013-02-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mike Vegeto |
| Maintainers | mvegeto |
| Keywords | file, generate, template, create, source, maker |

## Links

- npm: https://www.npmjs.com/package/maker
- Repository: http://github.com/ZECTBynmo/maker
- Homepage: https://github.com/ZECTBynmo/maker
- Issues: https://github.com/ZECTBynmo/maker/issues
- npm.io page: https://npm.io/package/maker

## Dependencies (4)

- [clone](https://npm.io/package/clone.md) ~0.1.6
- [wrench](https://npm.io/package/wrench.md) ~1.4.4
- [traverse](https://npm.io/package/traverse.md) ~0.6.3
- [isbinaryfile](https://npm.io/package/isbinaryfile.md) ~0.1.9

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.11 (latest) — 2014-04-05
- 0.1.9 — 2014-04-03
- 0.1.8 — 2013-10-07
- 0.1.7 — 2013-09-29
- 0.1.6 — 2013-09-29
- 0.1.5 — 2013-09-29
- 0.1.4 — 2013-08-30
- 0.1.3 — 2013-08-28
- 0.1.2 — 2013-08-25
- 0.1.1 — 2013-08-25
- 0.1.0 — 2013-07-13
- 0.0.14 — 2013-07-12
- 0.0.13 — 2013-07-12
- 0.0.12 — 2013-07-12
- 0.0.11 — 2013-06-29
- … 10 more at https://npm.io/package/maker/versions

## README

# maker

maker is a general purpose text file templating engine. Use it to create text files programmatically.

Installation
```
npm install maker
```

maker scans a directory for a collection of templates, and allows you to select and fill out those templates as needed. 

Here's an example template, lets say we save it as 'myTemplate.tpl'
```JavaScript
//////////////////////////////////////////////////////////////////////////
// ~~comment~~
function ~~functionName~~( ~~arguments~~ ) {
	~~contents~~
} // end ~~functionName~~()
```
The template is a copy of the code you're trying to output with the variables and custom names replaced with template strings. The default separation string is ~~, but it can be changed to anything by using the optional argument to the maker constructor.

Here's a basic usage example
```JavaScript
var maker = require("maker").createMaker();

// Load all template files (.tpl) within some directory
maker.loadTemplateDir( "./templates", function( templates ) {

	// Grab a copy of the templates we want to use
	var myTemplate = maker.getTemplate( "myTemplate" ),
		myOtherTemplate = maker.getTemplate( "myOtherTemplate" );

	// Fill out our templates with contents
	myTemplate.comment = "comment stuff";
	myTemplate.functionName = "SomeFunction";
	myTemplate.arguments = "";
	myTemplate.contents = "console.log('test');";

	myOtherTemplate.someThing = "someOtherThing";

	// Create an array of templates in the order that 
	// we want them to appear in the file
	fileTemplates = [];
	fileTemplates.push( myTemplate );
	fileTemplates.push( templates["myOtherTemplate"] );

	// Write the file
	maker.makeFile( "./testOutput.js", fileTemplates );
}
```

Ignoring the unspecified template 'myOtherTemplate', This script would render myTemplate.tpl as the following

```JavaScript
//////////////////////////////////////////////////////////////////////////
// comment stuff
function SomeFunction() {
	console.log('test');
} // end SomeFunction()
```

---
_Source: https://npm.io/package/maker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
