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

grunt-html-head-urls-min-toggle

v1.1.4

Published

Point the html-head href and src urls to minified sources and vice versa.

Readme

grunt-html-head-urls-min-toggle

Point the html-head href and src urls to minified sources and vice versa.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-html-head-urls-min-toggle --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-html-head-urls-min-toggle');

The "html_head_urls_min_toggle" task

Introduction

The "html_head_urls_min_toggle" task switches the "href" and "src" links in the head area ofNOT MINIFIEDhtml-files.

from e.g.:href="css/jquery-ui.css" src="javascript/jquery-3.1.0.js"

to:href="css/jquery-ui.min.css" src="javascript/jquery-3.1.0.min.js"

and vice versa.

The aim is to be maximum tolerant regarding an incorrect syntax and not to change anything else than the link itself. Files are only touched in case changes took place.

The generated output can be controlled by the Gruntfiles task option "chattiness_level". "chattiness_level : 0"or"chattiness_level : 1"can be added accordingly.

Of course source and destination is identical with such a task. Due to that a simple custom syntax is used inside the Gruntfile e.g.:

module.exports = function(grunt) {
      grunt.initConfig({
  ...
   html_head_urls_min_toggle : {
      any_proper_name : {
	      options : {
	            action : 'switch',
	            direction : 'regular',
	            file_source : 'wildcard',
	            chattiness_level : 0 or 1 
	          },
	          custom_files : [
	              {
	                cwd : './',
	                src : [ '*.max.html' ]
	              },
	              {
	                cwd : '../',
	                src : [ '*.big.html' ]
	              } ]
	        },
	        
      another_proper_name : {
	          options : {
	            action : 'switch',
	            direction : 'min',
	            file_source : 'list',
	            chattiness_level : 0 or 1
	          },
	          custom_files : ['file_no_one.max.html','file_no_two.max.html','file_no_three.max.html']
	        },

The only additional task is to "clean" the line endings of files regaring the current operating system. Placing "\x0d\x0a" at the end of each line on windows, and "\x0a" on Linux, OS X, Unix, etc. - Nothing else will be changed...:

      just_a_nice_name : {
	        options : {
	            action : 'clean',
	            file_source : 'wildcard',
	            chattiness_level : 0 or 1
	          },
	          custom_files : [ {
	            cwd : './',
	            src : [ '*.txt' ]
	          } ]
	        },    

      another_wonderful_name : {
	          options : {
	            action : 'clean',
	            file_source : 'list',
	            chattiness_level : 0 or 1
	          },
	          custom_files : ['file_no_one.txt','file_no_two.html','file_no_three.txt']
	        },
	     }
  ...
       });
};    

Release History

Version 1.0.0 - Should do the above job nicely... Version 1.0.1 - Documentation related... Version 1.0.2 - Documentation related... Version 1.0.3 - Documentation related... Version 1.0.4 - Documentation related... Version 1.0.5 - Proper documentation related tests... Version 1.0.6 - Proper documentation related tests... Version 1.0.7 - Added some more line breaks... :-) Version 1.0.8 - And some more text regarding the cleaning option... Version 1.0.9 - Added some keywords... Version 1.0.10 - The power of line breaks... :-) Version 1.0.11 - Highlight "not minified" html targets a bit more... with line breaks... :-) Version 1.0.12 - Placed stuff at GitHub - without additional line breaks... :-( Version 1.0.13 - Repaired a typo... Version 1.0.14 - Corrected the links inside package.json... Version 1.0.15 - Cleaned up the sample Gruntfile... Version 1.0.16 - Back to 1.0.15... Version 1.1.1 - Added a proper options handling and the "chattiness level"... Version 1.1.2 - Tested the related github communication... Version 1.1.3 - Tiny debug output modifications... Version 1.1.4 - Added three relevant "JSON.stringify(this)" samples...

Michael Hartung 23. August 2017

Have Fun!