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 🙏

© 2025 – Pkg Stats / Ryan Hefner

emerald-templates

v0.4.7

Published

Intelligent Template Generation & Project Management

Downloads

19

Readme

Emerald Templates

Intelligent Template Generation & Project Management

A list of useful templates

Getting Started

To install emerald templates run the following command in your console

npm install -g emerald-templates

Template Management

There are two ways to manage your template folders, either put them all inside a "root" template folder, or add all your templates one by one. You can add a new template root with this command

emt add-root <path>

Templates can be saved individually by running the following command

emt add-template <path>

Configuring

Emerald templates has a lot of shiny bells and whistles. In order to make sure emerald templates is behaving the way you'd like it to, consider configuring the project.

emt configure

Generating Projects

The following command can be used to generate projects from your templates

emt generate <template folder name> <output folder (relative or absolute)>

or you can simply leave off the generate commands

emt <template folder name> <output folder (relative or absolute)>

Any additional cli arguments supplied (use --) will be passed to your templates as variables

emt <template folder name> <output folder (relative or absolute)> --age 12

Command Documentation

To list the available commands run the help command

emt help

To get more information about a specific command supply the command name to the help argument

emt help <command>

Gems

Gems are like mini-templates inside of your template directory. They are for generating new things inside your projects after they have been created. To create a gem, inside of your template directory make a new folder called gems, and inside that make a new folder named whatever you want your gem to be called. After you have initialized your project with your template run the following command with the name of your folder inside of the "gems" folder from a terminal inside your new project directory.

emt gem <gem-name>

Anything inside of your gem folder will now be copied into the root of your new project, and like during generation, any appropriate scripts will be handled by Emerald-Templates.

Template Engine Files

Inside your template folders, any file ending with .emerald (this can be after their normal extension) will be run through the EJS templating engine. The .emerald file extension will automatically be stripped in the resulting projects when you generate them with the template.

Scripting

Any file ending with .emerald-script will automatically be executed. If it ends with .js.emerald-script it will be ran inside the current node context, otherwise it's contents will be split by lines, and executed one by one through the command line.

Linking

Any file ending with .emerald-link will be replaced with the file referenced in the first line of the link file, and have the .emerald-link extension stripped off. For Example if we create the following link file:

File Name: example.js.emerald-link Content:

C:\\Users\John\example1.js

This file will copy the file from C:\\Users\John\example1.js to example.js in the output folder. Additionally by providing the following special values you can reference important paths.

| String | Value | | ------------------------ | ----------------------------------------------------------------- | | {OUTPUT_FOLDER} | The folder the current project is being cloned to | | {OUTPUT_PATH} | The current file being cloned's destination | | {TEMPLATE_FOLDER} | The template folder we're copying from | | {LINK_FOLDER} | The parent folder of the {OUTPUT_PATH} | | {LINK_RELATIVE_FOLDER} | The relative path from the {OUTPUT_FOLDER} to the {LINK_FOLDER} | | {RELATIVE_PATH} | The relative path from the output folder to the output file |

.emignore ignore file

Because Emerald-Templates treats .gitignore files as regular files, the .emignore file can be used exactly in the same way in order to tell Emerald Templates what to copy and what not to copy

Other Features

  1. Automatically install node modules :D

  2. Automatically initialize the git repo

  3. Run a launch command (for example to open your IDE in a newly spawned project)

Note: You can configure these features with the config command