douglascrockford/JSLint — pull request #149 by huntc (2013-11-20 04:47:50+00:00)
Title: Exposing JSLint as a CommonJS module

I thought that it might be useful to expose the JSLINT function as a [CommonJS module export](http://wiki.commonjs.org/wiki/Modules/1.1.1). This same code should also allow [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) loaders such as [RequireJS](http://requirejs.org/) to function.

Given the change JSLint can be loaded thus:

var jslint = require("/path/to/jslint.js").JSLINT;

The support for CommonJS modules would also make JSLint available to [Node](http://nodejs.org/).

Finally we are building an [sbt plugin](http://www.scala-sbt.org/) for the [Play web development framework](http://www.playframework.com/) that uses JSLint and it would be easier for us to have CommonJS supported.