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

mimosa-jade-static

v0.1.2

Published

A Jade static client template compiler for Mimosa 2.0+

Downloads

14

Readme

mimosa-jade-static

Overview

This is a Jade to HTML compiler for the Mimosa build tool. This module is for use with Mimosa 2.0+.

For more information regarding Mimosa, see http://mimosa.io

Usage

Add 'jade-static' to your list of modules. That's all! Mimosa will install the module for you when you start mimosa watch or mimosa build.

After that, start creating your .jade files in the app/template folder. This files will be converted to HTML strings which are available on client-side through the templates object — the same as with other templating modules.

Functionality

This module will compile Jade files to HTML during mimosa watch and mimosa build.

This module utilizes all of the built-in template behavior that comes with Mimosa's basic template compiler. See the mimosa website for more information about how templates are treated or check out the various template configuration options.

Default Config

jade:
  lib: undefined
  extensions: [ "jade" ]
  context: null
  • lib: You may want to use this module but may not be ready to use the latest version of Jade. Using the lib property you can provide a specific version of Jade if the one being used by this module isn't to your liking. To provide a specific version, you must have it npm installed into your project and then provide it to lib. For instance: lib: require('jade').
  • extensions: an array of strings, the extensions of your Jade files.
  • context: an object passed to the compiled template function when generating HTML. If context is a function itself, it's being executed and the result is used as a context for the template.

How is it different from X?

There are several similar modules for Mimosa, let's see how do they differ from each other:

  • mimosa-html-templates takes the assets/javascripts/app/template/fileName.template HTML file and makes its content available as a string templates['fileName'].
  • mimosa-jade takes the assets/javascripts/app/template/fileName.jade Jade file and makes its content available as a function templates['fileName']. You can then call this function from your client-side code.
  • mimosa-client-jade-static takes the assets/javascripts/app/template/fileName.html.jade Jade file and transforms it to public/javascripts/app/template/fileName.html file.
  • mimosa-jade-static (this module) takes the assets/javascripts/app/template/fileName.jade Jade file and makes its content available as an HTML string templates['fileName'].

So, this module is basically the same as mimosa-html-templates, but allowing you to write you code in Jade.

Sample Use-Case

One particular use-case is when your framework allows programmatically passing chunks of HTML (potentially containing some client-side Mustache or EJS-like template instructions). For example, Angular allows you to pass HTML for custom components, and for "partials" — see official examples "Javascript Projects" and "Todo", correspondingly.

A full-featured sample project using Mimosa, Angular, RequireJS and this module can be found here.