diff --git a/lib/mock.js b/lib/mock.js index 5cfb3cf..4e53356 100644 --- a/lib/mock.js +++ b/lib/mock.js @@ -466,3 +466,10 @@ MockHttpServer.prototype = { // Instances should override this. } }; + +if (module && module.exports) { + module.exports = { + request: MockHttpRequest, + server: MockHttpServer + }; +} diff --git a/package.json b/package.json index a311419..5a0971c 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,27 @@ { - "name": "MockHttpRequest", - "description": "A mock implementation of XMLHttpRequest for unit testing", - "version": "1.0", - "keywords": ["testing", "unit", "mock", "ajax", "http", "request"], - "maintainers": [{ - "name": "Philipp von Weitershausen", - "email": "philipp@weitershausen.de", - "web": "http://philikon.de" - }], - "contributors": [{ - "name": "Philipp von Weitershausen", - "email": "philipp@weitershausen.de", - "web": "http://philikon.de" - }], - "bugs": "http://github.com/philikon/MockHttpRequest/issues", - "licenses": [{ - "name": "MIT", - "url": "http://www.opensource.org/licenses/mit-license.php" - }], - "repositories": [{ - "type": "git", - "url": "http://github.com/philikon/MockHttpRequest" - }], - "dependencies": [], - "homepage": "http://github.com/philikon/MockHttpRequest", + "name": "MockHttpRequest", + "main": "lib/mock.js", + "description": "A mock implementation of XMLHttpRequest for unit testing", + "version": "1.0", + "keywords": ["testing", "unit", "mock", "ajax", "http", "request"], + "maintainers": [{ + "name": "Philipp von Weitershausen", + "email": "philipp@weitershausen.de", + "web": "http://philikon.de" + }], + "contributors": [{ + "name": "Stephan Hoyer", + "email": "ste.hoyer@gmail.com" + }], + "bugs": "http://github.com/philikon/MockHttpRequest/issues", + "licenses": [{ + "name": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + }], + "repositories": [{ + "type": "git", + "url": "http://github.com/philikon/MockHttpRequest" + }], + "dependencies": [], + "homepage": "http://github.com/philikon/MockHttpRequest" }