Here's an alternate version that does not require --harmony for usage.

https://github.com/3rd-Eden/canihaz

- Which reads out the package.json file for definitions
- Installs the modules async

I'm using it in my build system to lazy install modules that are only used
by plugins.

On Wednesday, January 2, 2013 at 8:21 PM, nin jin wrote:

> 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] 
> (mailto:[email protected])
> To unsubscribe from this group, send email to
> [email protected] 
> (mailto:[email protected])
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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

Reply via email to