browserify
Advanced tools
Comparing version 0.2.9 to 0.2.10
@@ -14,3 +14,3 @@ var fs = require('fs'); | ||
return function (req, res, next) { | ||
if (req.url.split('?')[0] === opts.mount || '/browserify.js') { | ||
if (req.url.split('?')[0] === (opts.mount || '/browserify.js')) { | ||
res.writeHead(200, { | ||
@@ -17,0 +17,0 @@ 'Last-Modified' : modified.toString(), |
{ | ||
"name" : "browserify", | ||
"version" : "0.2.9", | ||
"version" : "0.2.10", | ||
"description" : "Browser-side require() for js directories and npm modules", | ||
@@ -45,3 +45,3 @@ "main" : "./index.js", | ||
"license" : "MIT/X11", | ||
"engine" : ["node >=0.4.0"] | ||
"engine" : { "node" : ">=0.4.0" } | ||
} |
@@ -9,2 +9,4 @@ Browserify | ||
![browserify!](http://substack.net/images/browserify/browserify.png) | ||
More features: | ||
@@ -217,1 +219,6 @@ | ||
deployment! | ||
read more | ||
========= | ||
[browserify: browser-side require() for your node.js](http://substack.net/posts/24ab8c) |
@@ -5,2 +5,3 @@ var assert = require('assert'); | ||
var Script = process.binding('evals').Script; | ||
var fs = require('fs'); | ||
@@ -25,6 +26,9 @@ var foo = require('./simple/foo'); | ||
})); | ||
server.listen(port, makeRequest); | ||
server.use(connect.static(__dirname + '/simple')); | ||
server.listen(port, function () { | ||
checkStatic(makeRequest); | ||
}); | ||
var to = setTimeout(function () { | ||
assert.fail('server never started'); | ||
assert.fail('request test never started'); | ||
}, 5000); | ||
@@ -36,2 +40,28 @@ | ||
var ts = setTimeout(function () { | ||
assert.fail('static test never started'); | ||
}, 5000); | ||
function checkStatic (cb) { | ||
clearTimeout(ts); | ||
var req = { host : 'localhost', port : port, path : '/' }; | ||
http.get(req, function (res) { | ||
assert.eql(res.statusCode, 200); | ||
var src = ''; | ||
res.on('data', function (buf) { | ||
src += buf.toString(); | ||
}); | ||
res.on('end', function () { | ||
assert.eql( | ||
src, | ||
fs.readFileSync(__dirname + '/simple/index.html', 'utf8') | ||
); | ||
cb(); | ||
}); | ||
}); | ||
} | ||
function makeRequest () { | ||
@@ -38,0 +68,0 @@ clearTimeout(to); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46063
51
1099
223
10