node package manager


Generator microlib

Build Status

A Yeoman generator for browser microlibs.

A microlib or micro-library is a javascript component that has a specific usecase and often a limited set of features. Great microlibraries have no dependecies and don't get in each others way.


Even if microlibs are small they can still benefit from using tools such as Grunt and Bower. generator-microlib is a Yeoman generator that will quickly get you a suitable setup to start leveraging these tools.

Microlibs are often components within a larger project you are working on, that could benefit others. By providing a quick way to test, package and distribute components, hopefully more people will find some time to do so.


The generator provides the following files.

|- mylib
   |- .editorconfig  // Example .editorconfig (
   |- .gitignore     // Basic .gitignore
   |- .jshintrc      // Example JSHint configuration (
   |- .travis.yml    // Example Travis configuration (
   |- Grunfile.js    // Basic Grunt configuration
   |-      // Empty README file
   |- bower.json     // Basic Bower configuration
   |- package.json   // Basic Npm configuration
   |- dist           // Folder for your distributables
      |- <lib>.min.js
   |- lib            // Folder for your library !!
      |- <lib>.js
   |- tests          // Folder for your tests
      |- <test>.js

The generator provides the following grunt tasks.

jshint concat uglify [qunit/intern]

$ grunt hint // will run jshint
$ grunt test // will run qunit/intern
$ grunt      // will run test, concat, uglify

Getting started

Make sure you have yo installed: npm install -g yo

Install the generator & create your project.

$ npm install -g generator-microlib
$ mkdir mylib && cd mylib
$ yo microlib
$ grunt



MIT License



  • Added mocha support (grunt-mocha-test)
  • Added .bowerrc
  • Updated qunit & intern packages
  • Renamed tests folder & test.js file
    • ./tests -> ./test
    • test.js -> spec.js


QUnit now expects an up-to-date bower version. Or rather; QUnit's test/test.html references qunit from a bower_components dir in project root. The included .bowerrc should automatically fix this.


  • A few fixes to support latest yeoman-generator & yo


  • Updated yeoman-generator dependency to leverage Inquirer for list prompts
    • (Two updates in one day? Weee…!)
    • (Note to self: Read up on semver :-P)


  • Library example is now browser & amd compatible by default.


  • Templating out library name
  • Supporting multiple test frameworks
  • Actually using .jshintrc
  • Moved hinting into separate grunt task
  • Added .travis.yml & build status link to
  • Updated versions
  • General cleanup

Pre 0.1.4

Had no changelog, can't remember. Stuff happened.