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

jaderunner

v0.0.4

Published

Executes Jade templates

Downloads

7

Readme

jaderunner

Simple package for executing Jade templates from the command-line.

Install

npm install --save jaderunner

Usage

jaderunner [-a <asset_home>] [-j <json_data>] <template_file> <output_file> ["json_string"]
  1. If -a is set use <asset_home> for global path to other Jade assets, otherwise use the value of the ASSET_HOME environment variable
  2. Loads and compiles the Jade template <template_file>
  3. If -j is specified, read <json_data> as locals
  4. If "json_string" is present, evaluate it and add result to locals
  5. Execute template using locals
  6. Write output HTML to <output_file>

Examples

// Execute simple.jade and write to out.html
jaderunner simple.jade out.html

// The same, using default extensions 
jaderunner simple out

// Supply some locals to the template
jaderunner simple out "{title:'The title',x:42}"

// Read locals from data.json
jaderunner -j data.json simple out
jaderunner -j data simple out

API

jaderunner.compile(string, [object])

Example: jaderunner.compile('template.jade')

Loads and compiles a Jade template, returning an object with the keys:

  • source_file: file name of Jade template
  • source: source of template
  • options: compilation options
  • func(object): Jade compiled template function
  • render(string, object): runs the template with the object as its locals, and writes the output to the file given by the first parameter

E.g.

var tmpl = jaderunner.compile('simple.jade');
tmpl.render('output.html', {
  title: 'My title'
});

License

MIT © James Skinner