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

jadent

v0.0.10

Published

A command line tool to compilie jade templates for use in running on browsers.

Downloads

5

Readme

jadent

A command line tool to compilie jade templates for use in running on browsers.

Inspired by https://github.com/jgallen23/clientjade.

Getting started

$ npm install jadent

How to use

Basic usage

$ jadent --help

  Usage: jadent [options] source target

  Options:

    -h, --help                   output usage information
    -V, --version                output the version number
    -w, --watch                  watch folder for file changes
    -n, --namespace <namespace>  add namespace and wrap by nameless immediately-invoked function
    -u, --uglify                 uglify client side template
    -r, --runtime                include jade runtime which is necessary for client browser


  Examples:


    jadent views/client public/javascripts
      -> compile jade templates in views/client into public/javascripts/jadent.js


    jadent views/client/index.jade public/javascripts
      -> compile views/client/index.jade into public/javascripts/jadent.js


    jadent views/client public/javascripts/index.js
      -> compile jade templates in views/client into public/javascripts/index.js


    jadent views/client/index.jade public/javascripts/index.js
      -> compile views/client/index.jade into public/javascripts/index.js
var jadent = {};
jadent["index"] = function(locals) {
  var buf = [];
  var jade_mixins = {};
  var jade_interp;;
  var locals_for_with = (locals || {});
  (function(name, title) {
    buf.push("<!DOCTYPE html><html lang=\"en\"><head><title>" + (jade.escape(null == (jade_interp = title) ? "" : jade_interp)) + "</title></head><body><h1>jadent sample jade template</h1><p>Hello, " + (jade.escape((jade_interp = name) == null ? '' : jade_interp)) + " !</p></body></html>");
  }.call(this, "name" in locals_for_with ? locals_for_with.name : typeof name !== "undefined" ? name : undefined, "title" in locals_for_with ? locals_for_with.title : typeof title !== "undefined" ? title : undefined));;
  return buf.join("");
}

-w, --watch

Watch folder for file changes in source folder/file to recreate templates

Example

Two jade templates are in ./views/, and they are compiled whenever they are modified.

$ jadent --watch ./views/client ./public/javascripts

Starting Watching folder ./views/client

File added: views/client/index.jade
Created public/javascripts/jadent.js

File added: views/client/signin.jade
Created public/javascripts/jadent.js

# views/client/index.jade was modified.
File changed: views/client/index.jade
Created public/javascripts/jadent.js

# views/client/signin.jade was removed.
File removed: views/client/signin.jade
Created public/javascripts/jadent.js

-n, --namespace

Add namespace and wrap by nameless immediately-invoked function

Example
$ jadent --namespace namespace ./views/client ./public/javascripts

Two jade templates are in ./views/client.

// ./views/client/index.jade
doctype html
html(lang="en")
  head
    title= title
  body
    h1 jadent sample jade template
    p Hello, #{name} !
// ./views/client/sigin.jade
doctype html
html(lang="en")
  head
    title= title
  body
    h1 jadent sample jade template
    input(type='text' name='username')
    input(type='password' name='password')

They are compiled with option -n namespace into ./public/javascripts/jadent.js.

// ./public/javascripts/jadent.js
var namespace = namespace || {};
namespace.jadent = {};
(function(jadent) {
  jadent["index"] = function(locals) {
    var buf = [];
    var jade_mixins = {};
    var jade_interp;;
    var locals_for_with = (locals || {});
    (function(name, title) {
      buf.push("<!DOCTYPE html><html lang=\"en\"><head><title>" + (jade.escape(null == (jade_interp = title) ? "" : jade_interp)) + "</title></head><body><h1>jadent sample jade template</h1><p>Hello, " + (jade.escape((jade_interp = name) == null ? '' : jade_interp)) + " !</p></body></html>");
    }.call(this, "name" in locals_for_with ? locals_for_with.name : typeof name !== "undefined" ? name : undefined, "title" in locals_for_with ? locals_for_with.title : typeof title !== "undefined" ? title : undefined));;
    return buf.join("");
  }
  jadent["signin"] = function(locals) {
    var buf = [];
    var jade_mixins = {};
    var jade_interp;;
    var locals_for_with = (locals || {});
    (function(title) {
      buf.push("<!DOCTYPE html><html lang=\"en\"><head><title>" + (jade.escape(null == (jade_interp = title) ? "" : jade_interp)) + "</title></head><body><h1>jadent sample jade template</h1><input type=\"text\" name=\"username\"><input type=\"password\" name=\"password\"></body></html>");
    }.call(this, "title" in locals_for_with ? locals_for_with.title : typeof title !== "undefined" ? title : undefined));;
    return buf.join("");
  }
})(namespace.jadent);

-u, --uglify

Uglify client side template javascript file

Example
$ jadent --uglify ./views/client ./public/javascripts

-r, --runtime

Include jade runtime.js in target file

Example
$ jadent --runtime ./views/client ./public/javascripts