handy development time middleware for projects written in the spirit of the commonjs module system
Want to see pretty graphs? Log in now!
npm install serve-js
|2||downloads in the last week|
|81||downloads in the last month|
|Last Published By|
|Version||0.5.2 last updated 2 months ago|
|Dependencies (6)||foreach, sourcegraph, result-type, cheerio, bigfile, result|
handy development time middleware for projects which are written in the spirit of the commonjs module system. Its designed to integrate with a connect style static file server. It will filter requests looking for either a ".js" extension or an ".html". If it finds a ".js" it will send the corresponding file but with all its dependencies consolidated with it. Think of it like a run-able tarball. If it finds a ".html" extension it looks at the corresponding file and if it has only one in-line script tag it assumes you mean to compile the code in-line and does so. This is a really nice feature if your creating a lot of small examples etc..
$ npm install serve-js --save
then in your express/connect app:
var serveJS = require('serve-js') app.use(serveJS(process.cwd()))
for now just take a look at the tests.
Running the tests
$ npm install $ make test $ open http://localhost:3000/test/inline.html $ open http://localhost:3000/test/external.html