Browse files

Updated docs

  • Loading branch information...
1 parent 260698a commit 157987bc5464e1dcc9f9e287cbd1f42836399890 @kriszyp committed Mar 13, 2010
Showing with 10 additions and 4 deletions.
  1. +10 −4 README.md
View
14 README.md
@@ -1,12 +1,15 @@
Transporter is JSGI application that serves modules to the browser with dependencies
included and packaged in the CommonJS module transport format:
-http://wiki.commonjs.org/wiki/Modules/Transport/C
+
+[[http://wiki.commonjs.org/wiki/Modules/Transport/C]]
+
This format permits asynchronous loading of modules and combining multiple modules
(modules with their dependencies) into single responses. Transporter should work
with any client side module loader that supports the CommonJS module transport
format. This has been primarily tested with RequireJS (and require.js from this project
is included):
-http://github.com/jrburke/requirejs
+
+[[http://github.com/jrburke/requirejs]]
To use transporter, include the appliance in your JSGI stack:
@@ -57,7 +60,8 @@ in the given response. For example:
<script src="shared.js"></script>
<script src="page-a-module.js,-shared.js"></script>
-require.js provides
+RequireJS provides additional facilities for asynchronously loading of modules
+which can be very useful for loading modules on demand.
The Transporter appliance can also be configured to support different scenarios. The
first parameter is next JSGI application, so Transporter can be used as middleware.
@@ -66,8 +70,10 @@ The second parameter is the options, which can have two properties:
* url - The URL path prefix for all the javascript libraries that will be processed by the Transporter. This defaults to "/lib/".
* paths - The set of paths to lookup modules in. The defaults to require.paths set of paths where any /engines/some-engine paths replaced with a /engines/browser path.
+For example:
+
require("transporter").Transporter(nextApp, {
url:"/js/",
paths: ["/some/path"]
});
-
+

0 comments on commit 157987b

Please sign in to comment.