Permalink
Browse files

Merge pull request #724 from bkw/npmFix2

This patch makes it possible to require JSHint as an NPM module.
  • Loading branch information...
2 parents 3148362 + 6d8fa1b commit 4ad295fc849018b17e9f85752eb80a0c37ce3e8f @valueof valueof committed Oct 31, 2012
Showing with 32 additions and 22 deletions.
  1. +24 −22 package.json
  2. +8 −0 tests/stable/regression/npm.js
View
@@ -1,37 +1,39 @@
{
- "name": "jshint",
- "version": "1.0.0",
- "homepage": "http://jshint.com/",
- "description": "Static analysis tool for JavaScript",
+ "name": "jshint",
+ "version": "1.0.0",
+ "homepage": "http://jshint.com/",
+ "description": "Static analysis tool for JavaScript",
- "author": {
- "name": "Anton Kovalyov",
- "email": "anton@kovalyov.net",
- "url": "http://anton.kovalyov.net/"
- },
+ "author": {
+ "name": "Anton Kovalyov",
+ "email": "anton@kovalyov.net",
+ "url": "http://anton.kovalyov.net/"
+ },
"scripts": {
"test": "node ./make.js test",
"lint": "node ./make.js lint"
},
- "dependencies": {
- "esprima": "https://github.com/ariya/esprima/tarball/master",
+ "main": "./src/stable/jshint.js",
+
+ "dependencies": {
+ "esprima": "https://github.com/ariya/esprima/tarball/master",
"shelljs": "*",
- "underscore": "*",
- "peakle": "*",
- "cli": "0.4.3",
- "minimatch": "0.0.x"
- },
+ "underscore": "*",
+ "peakle": "*",
+ "cli": "0.4.3",
+ "minimatch": "0.0.x"
+ },
- "devDependencies": {
+ "devDependencies": {
"jshint": "*",
"shelljs": "*",
- "browserify": "*",
- "coveraje": "*",
- "nodeunit": "*",
+ "browserify": "*",
+ "coveraje": "*",
+ "nodeunit": "*",
"sinon": "*"
- },
+ },
- "preferGlobal": true
+ "preferGlobal": true
}
@@ -0,0 +1,8 @@
+"use strict";
+
+exports.npm = function (test) {
+ var jshint;
+ test.ok(jshint = require(__dirname + '/../../../'));
+ test.equal(typeof(jshint.JSHINT), 'function');
+ test.done();
+};

0 comments on commit 4ad295f

Please sign in to comment.