Skip to content
Browse files

Getting the module ready for publishing on npm

Write README, add License and update package.json
  • Loading branch information...
1 parent de5782b commit db4e7f8d9c52c84b7739a871928e7c4620d2455e @gillesruppert committed Aug 20, 2012
Showing with 89 additions and 8 deletions.
  1. +22 −0 LICENSE
  2. +49 −0 README.md
  3. +18 −8 package.json
View
22 LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2012 Gilles Ruppert <gilles@madeofbytes.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
49 README.md
@@ -1,2 +1,51 @@
Webmake middleware for express and connect
==========================================
+
+This module is a simple helper to make development with [webmake][1] straight-forward to set up. Webmake is a lightweight client-side dependency management tool that allows you to use node modules in the browser. You can read up on it [here][1].
+
+This module is a simple middleware for [connect][2] and its cousin [express][3].
+
+## To install
+
+ npm install webmake-middleware
+
+## Usage
+
+If you are already using `express` or `connect` for your app, simply configure your server to use the middleware. Since this middleware is currently only for use during development, make sure you put it into the `development` configuration of your `express` application! In the future, there is a good chance that it can be configured to be used for production as well so that it doesn't re-compile the scripts on each request and that the cache headers are configurable.
+
+```javascript
+var connect = require('connect'); // this could also be express
+var webmakeMiddleware = require('webmake-middleware');
+
+// the `/build.js` url is the request url. `/path/to/main.js` is the path to the
+// main entry point.
+var server = connect().use(webmakeMiddleware('/build.js', '/path/to/main.js'));
+// add other middleware as necessary
+
+server.listen(3000);
+```
+
+If your app only every uses 1 script, the 1st argument is the url to the script and the 2nd argument the absolute path to the entry point of your app, i.e. `main.js`.
+
+If your app uses multiple scripts, i.e. for different pages, you can pass an `object` where the key is the `url` and the value is the `path`.
+
+```javascript
+webmakeMiddleware({
+ '/core.js': '/absolute/path/to/main.js',
+ '/page2.js': '/absolute/path/to/page2main.js'
+})
+```
+
+**N.B: the path to the file needs to be absolute so you will have to construct it with `path.normalize(__dirname + '/path/to/main.js')` or similar**
+
+## Tests
+
+ # in the webmake-middleware directory
+ npm install
+ npm test
+
+
+
+[1]: http://github.com/medikoo/modules-webmake
+[2]: http://www.senchalabs.org/connect/
+[3]: http://expressjs.com
View
26 package.json
@@ -1,28 +1,38 @@
{
"name": "webmake-middleware",
- "version": "0.0.0",
+ "version": "0.0.1",
"description": "connect and express middleware for webmake",
- "main": "lib/webmake-middleware.js",
- "scripts": {
- "test": "./node_modules/.bin/mocha test/*-test.js"
- },
"keywords": [
"webmake",
"middleware",
"connect",
"express",
"browser"
],
- "author": "Gilles Ruppert",
+ "author": "Gilles Ruppert <gilles@madeofbytes.com>",
+ "main": "lib/webmake-middleware.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/gillesruppert/webmake-middleware"
+ },
+ "bugs": {
+ "url": "https://github.com/gillesruppert/webmake-middleware/issues"
+ },
+ "scripts": {
+ "test": "./node_modules/.bin/mocha test/*-test.js"
+ },
"license": "MIT",
+ "dependencies": {
+ "webmake": "0.3.x"
+ },
"devDependencies": {
"connect": "~2.4.3",
"express": "~3.0.0rc3",
"mocha": "~1.3.2",
"expect.js": "~0.1.2",
"async": "~0.1.22"
},
- "dependencies": {
- "webmake": "~0.3.11"
+ "engines": {
+ "node": "0.8.x"
}
}

0 comments on commit db4e7f8

Please sign in to comment.
Something went wrong with that request. Please try again.