node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey ยป


There are many generation tools out there... so what makes Turret any different? Turret doesn't rewrite or introduce a large number of new conventions. It uses npm directly for generator you'll want to install and use and the majority of generators you create will be a template directory and a schema.js configuration module. That's it, which is fairly simple.

The power of Turret comes from it's underscore templating implementation. Each file in your template folder will be run through a templating function. This way you can conditionally be altering the code that is generated with logic you or the user provides.


$ npm install turret -g

Installing and running a Turret

$ turret install turret-webapp
$ turret run turret-webapp

Creating a Turret

$ turret init

Now you can work on your Turret before pushing it out to npm.

The template folder...

The template folder is the heart of every Turret you will create and/or use. The files within the directory will all be copied and moved into the newly created project.

Concider the following directory structure within a Turret's template directory:

	-> index.html


		<? if (foo) { ?>
			<script src=""></script>
		<? } ?>

When the Turret is run index.html is run through a templating function where it can react to foo.

So where do the variables passed to the templating method come from?

Good question. There are two places where data passed to the templating function come from and they both (somewhat) come from the Turret's schema.js module.

The schema module...

Each Turret contains a schema.js module that sits next to it's template folder. The following is an example:

module.exports = {
	prompt: {
		properties: {
	template: {

The prompt export contains items you wish to prompt the user for when they install and run the Turret. For a detailed list of the prompt properties see

The template export contains any other data that you want to make available to the files as they are passed through the templating function during project generation.

Turret Commands

$ turret <command> [program]



$ turret init

Create a new turret.


$ turret run turret-webapp

Run an installed turret's generation.


$ turret install turret-webapp

Install a turret from either npm or a git repo.


$ turret uninstall turret-webapp

Uninstall a turret from either npm or a git repo.


$ turret update turret-webapp

Update a turret to the newest or a passed version.