0.2.0 • Published 10 years ago

gourmet-generator v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 years ago

Gourmet

Create tasteful scripted templates for your repetiteve work. After that just do ./gourmet tasteful-script.js and enjoy! Use it to generate entities, rest routes, sql files, and anything else where a kickstart will be welcome.

Simple

Use js to explain what you want to do with a template. First example:

var tmpl = 'Hello {{name}}';
var value = { name: 'Daniel' };
var txt = tt.mustache(tmpl, value)
tt.save('file-name.txt', txt)

Usage

  1. Install gourmet-generator globally npm install -g gourmet-generator

  2. Create a gourmet template script (like the one above) and save somewhere like /folder/templates/ex.js

  3. Inside a cmd use: gourmet /folder/templates/ex.js param1 param2 param3

API

The tt is a global variable to execute frequently required stuff like:

  1. Save a file: tt.save(file, text); where file is a path related to the folder where you currently are and text is the text that you want to save in utf8

  2. Read: Sometimes its better to write the mustache files on its own file. tt.read(file) where file is a path related to the folder where you currently are

  3. Render mustache: Will transform a mustache template and an object with values into a string tt.mustache(template, values)

0.2.0

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago