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

yhandlebars

v0.0.6

Published

Command line tool to precompile Handlebars templates as YUI modules

Readme

yhandlebars

yhandlebars is a YUI handlebars based command-line application for precompiling templates as YUI modules. Checkout the official Handlebars docs site at www.handlebarsjs.com and the official YUI Handlebars docs at yuilibrary.com/yui/docs/handlebars/.

Precompiling Templates

Handlebars allows templates to be precompiled and included as javascript code rather than the handlebars template allowing for faster startup time.

Installation

The precompiler script may be installed via npm using the npm install -g yhandlebars command.

Usage

Precompile handlebar templates.
Usage: yhandlebars <template> ...

Options:
  -f, --output     Output File                                                                [string]
  -k, --known      Known helpers                                                              [string]
  -o, --knownOnly  Known helpers only                                                         [boolean]
  -m, --min        Minimize output                                                            [boolean]
  -s, --simple     Output template function only.                                             [boolean]
  -r, --root       Template root. Base value that will be stripped from template names.       [string]
  -n, --namespace  Namespace in which the templates object will reside under the Y instance.  [string]  [default: "Handlebars"]
  -p, --plain      Plain module output without YUI.add(...) wrapper function.                 [boolean]

Simple mode

If using the simple mode the precompiler will generate a single javascript method.

Module mode

If using the precompiler's normal mode, the resulting templates will be stored to the Y.Handlebars.templates object using the relative template name sans the extension. These templates may be executed in the same manner as templates.

Namespacing

To change the location where the templates object should be stored on the Y instance just pass a namespace argument like this -n NS and the templates will be stored to Y.NS.templates.

Mustache compatible

The compiler will also precompile *.mustache and *.hbs files.

Using templates in YUI

The templates will be wrapped in a YUI.add(...) call to be used as a YUI module. The name of the module will be the relative -f output file name sans the extension. If the -f argument is not given the module name will default to handlebars-templates.

Since the module is configured to require handlebars-base you can simply use the module in YUI like this:

<!DOCTYPE html>
<meta charset="utf-8">
<title>My Favorite Food</title>

<body>
<div id="content"></div>

<script src="http://yui.yahooapis.com/3.6.0/build/yui/yui-min.js"></script>
<script>
YUI().use("handlebars-templates", "node", function (Y) {
    
    // Render the template and insert its output into the page.
    var output = Y.Handlebars.templates["my-template"]({food: "pie"});
    Y.one("#content").append(output);
});
</script>
</body>

Handlebars.js

yhandlebars is a port of the handlebarsjs command-line application to YUI handlebars.