Create a shim set using node.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
shims
.gitignore
cli.js
index.js
package.json
readme.md

readme.md

shimly dependency Status

Create a JavaScript shim set using node.

List of shims:

  • Array.isArray (Array.isArray() - MDN)
  • Array.every (Array.prototype.every() - MDN)
  • Array.filter (Array.prototype.filter() - MDN)
  • Array.forEach (Array.prototype.forEach() - MDN)
  • Array.indexOf (Array.prototype.indexOf() - MDN)
  • Array.map (Array.prototype.map() - MDN)
  • Array.reduce (Array.prototype.reduce() - MDN)
  • Array.some (Array.prototype.some() - MDN)
  • Element.classList (Element.classList - Eli Grey's classList.js)
  • Fetch API (fetch()Github polyfill)
  • Function.bind (Function.prototype.bind() -MDN)
  • Object.assign (Object.assign() - MDN)
  • JSON (JSON.stringify() and JSON.parse() - Douglas Crockford's JSON 2)
  • localStorage (Window.localStorage and Window.sessionStorage polyfill via cookies - Remy Sharp's Gist)
  • requestAnimationFrame (Window.requestAnimationFrame() polyfill Paul Irish's Gist)
  • EventListener (EventListener polyfill – Jonathan Neal)
  • Document.getElementsByClassName (getElementsByClassName polyfill – SitePoint)
  • String.trim (String.prototype.trim()MDN)
  • matchMedia (matchMedia()MDN)

Install:

$ npm install shimly

API:

shimly.shim(shims, minify, destination); //create shim set
shimly.list(); //lists available shims

Usage:

// ...
    var shimly = require('shimly')

	shimly.shim(['Array.every', 'Array.forEach'], false, 'shims.js');
// ...

CLI

Usage: shimly [options]

Options:

  -h, --help            output usage information
  -V, --version         output the version number
  -m, --minify          Minify
  -s, --shims <items>   Add the specified shims, comma separted
  -o, --output [value]  Output file
shimly -m -o file.js -s Array.every,JSON