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

grunt-hustler

v4.0.6

Published

A collection of grunt tasks

Downloads

20,672

Readme

build status NPM version dependency status

grunt-hustler

Contents

What is grunt-hustler?

A collection of grunt tasks.

  • hash - renames files based on their hashed contents
  • minifyHtml - minifies html views (not using grunt-contrib until their minifier supports valueless attributes and xml namespaces)
  • shimmer - creates a RequireJS main file
  • ngTemplateCache - creates a JavaScript file, placing all views in the AngularJS $templateCache
  • template - compiles views containing Lo-Dash template commands.

Installation

$ npm install grunt-hustler

Usage

Include the following line in your Grunt file.

grunt.loadNpmTasks('grunt-hustler');

Bust

Bust provides cache busting by renaming files with a hash based on their contents. It also replaces all instances of the file references.

Example Config:

_grunt.config('bust', {
  images: {
    files: [
      {
        cwd: '/temp/',
        src: ['images/**/*.png'],
        dest: '/temp/',
        replaceIn: {
          files: ['/temp/styles/styles.css']
        }
      }
    ]
  }
});

Hash

Renames files based on the hash of their contents.

scripts.min.js -> scripts.min.abse455dcd.js

Example Config:

_grunt.config('hash', {
  scripts: {
    files: [
      {
        cwd: '/temp/',
        src: ['scripts/scripts.min.js'],
        dest: '/temp/scripts/'
      }
    ]
  }
});

MinifyHtml

Minifies Html

Example Config:

_grunt.config('minifyHtml', {
  scripts: {
    files: [
      {
        src: 'index.html',
        dest: '/scripts/'
      }
    ]
  }
});

ngTemplateCache

Creates a script file pushing all views from html files into Angular's template cache.

Example Config:

_grunt.config('ngTemplateCache', {
  views: {
    files: [
      {
        './scripts/views.js': './views/**/*.html'
      }
    ]
  }
});

Options: Trim option allows to remove directory name from before adding the path to the ngTemplateCache's registry. If you are working in a temporary directory working directory while running the grunt task, this is particularly helpful.

options: {
  trim: '/temp'
}

Versioning

For transparency and insight into our release cycle, and for striving to maintain backwards compatibility, this module will be maintained under the Semantic Versioning guidelines as much as possible.

Releases will be numbered with the follow format:

<major>.<minor>.<patch>

And constructed with the following guidelines:

  • Breaking backwards compatibility bumps the major
  • New additions without breaking backwards compatibility bumps the minor
  • Bug fixes and misc changes bump the patch

For more information on SemVer, please visit http://semver.org/.

Bug tracker

Have a bug? Please create an issue here on GitHub!

https://github.com/CaryLandholt/grunt-hustler/issues

Author

Cary Landholt

  • http://twitter.com/CaryLandholt
  • http://github.com/CaryLandholt

License

Copyright 2013 Cary Landholt

Licensed under the MIT license.