npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

turret

v0.1.7

Published

Template scaffolding library.

Readme

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.

Installation

$ npm install turret -g

Installing and running a Turret

$ mkdir PROJECT_DIR && cd PROJECT_DIR
$ turret install turret-webapp
$ turret run turret-webapp

Creating a Turret

$ mkdir MY_TURRET_DIR && cd MY_TURRET_DIR
$ 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:

template
	-> index.html

index.html

<html>
	<head>
		<? if (foo) { ?>
			<script src="http://www.example.com/some-script.js"></script>
		<? } ?>
	</head>
	<body></body>
</html>

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: {
		foo:"bar"
	}
};

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 https://github.com/flatiron/prompt.

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]

Commands:

init

$ turret init

Create a new turret.

run

$ turret run turret-webapp

Run an installed turret's generation.

install

$ turret install turret-webapp

Install a turret from either npm or a git repo.

uninstall

$ turret uninstall turret-webapp

Uninstall a turret from either npm or a git repo.

update

$ turret update turret-webapp

Update a turret to the newest or a passed version.