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 🙏

© 2024 – Pkg Stats / Ryan Hefner

stencils

v0.9.5

Published

A simple CLI tool for managing and generating templates for projects; a simplified yeoman.

Downloads

32

Readme

Stencils

DISCLAIMER: This is an alpha project and as such has not settled on a stable API.

A simple CLI tool for managing and generating templates for projects; a simplified yeoman.

Getting Started

Installation

  npm i -g stencils

Setup

Stencil Projects are folders that have a .stlrc file and .stencils directory.

  stl init

When determining if a project is a stencils project stencils looks at the current project and checks for the .stlrc file. If it doesn't find one in the current directory stencils will crawl the file system up until it reaches the users home directory.

NOTE: do not initialize stencils as root or outside of the user directory

Adding Templates

Stencils uses a structured filesystem format to store the templates in the project. New Templates must be added with:

  stl add templateName

'Add' will prompt for what the filetype is for the template

Listing Templates

  stl ls

List files with extensions

  stl ls -a

Editing templates

For convenience you can open the files with:

 stl open templateName

Or specify an application with:

  stl open -a WebStorm templateName

Using Templates

  stl use templateName

'Use' will scan the template for all the template variables and prompt for the data.

Template Engine settings

Stencils supports Ejs and Mustache out-of-the-box, but defaults to ejs. Each of these template engines can be configured in the .stlrc file.

For example with ejs:

  {
    "version": "0.8.5-alpha",
    "engine": "ejs",
    "ejs": {
      "delimiter": "@" 
    }
  }

or with mustache

  {
    "version": "0.8.5-alpha",
    "engine": "mustache",
    "mustache": {
      "tags": ["<%", "%>"] 
    }
  }

the default engine can be overridden at run-time by passing the --engine flag with the name of the engine.

 stl add service --engine mustache
 stl use service --engine mustache

The order of operations for how stencils decides which engine to use is from left to right, where left has the most authority cli -> config -> default

It's important to note that files added with different engines are considered different templates and will be displayed with their appropriate engine when running stl ls

Roadmap

  • 0.5.0-alpha - ~~support for meta files and template reading for data population~~
  • 0.7.0-alpha - ~~add command class and extend each command from class (will be used to hold some option)~~
  • 0.8.0-alpha - ~~change default engine to ejs~~
  • 0.8.5-alpha - ~~support ejs/mustache options (including custom delimiter/tags)~~
  • 0.9.0-alpha - ~~support user level rc file, support rc file find up (similar to .npmrc behavior)~~
  • 0.20.0-alpha - support for directory type templates
  • 0.30.0-alpha - support for groups (defaults to local)
  • 0.40.0-alpha - unit and integration tests
  • 0.45.0-alpha - get jsdoc working
  • 0.50.0-alpha - add bash auto completion support
  • 0.54.0-alpha - update help text and cli output text
  • 0.56.0-alpha - simplify README
  • 0.58.0-beta - beta release
  • 1.0.0-rc1 - release candidate
  • 1.0.0 - public release

Feature Ideas

  • remote templates
  • core templates (pre-established templates) using the groups feature TBD in 0.30.0-alpha
  • symlink templates

Want to help or have an idea?

Create feature request ticket or Email