You need to run your script with *--harmony* parameter!
Autoloader
Connect autoloader:
$= require( 'jin' ).loader()
Then use this pattern to work with modules:
var app= $.connect( $.connect.static( 'public' ) )
$.http.createServer( app ).listen( 80 )
Instead of:
var connect= require( 'connect' )
var http= require( 'http' )
var app= connect( connect.static( 'public' ) )
http.createServer( app ).listen( 80 )
You can use customized loaders:
$my= $.jin.loader( './' )
$my.init() // loads ./init.js
If module is not installed, $.jin.loader tries to install that by npm. But
this feature uses fibers! Wrap your application to fiber by "sync" module:
$.sync( function( ){
var app= $.connect( $.connect.static( 'public' ) )
$.http.createServer( app ).listen( 8080 )
} )
This code may autoinstall "connect" module if needed, loads them, and then
run the server.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en