Created
November 25, 2011 15:36
-
-
Save kompiro/1393801 to your computer and use it in GitHub Desktop.
node-ninjaでcoffeescriptを使うの術
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Your App Name" | |
, "version": "0.0.1" | |
, "dependencies" : { | |
"coffee-script": ">= 1.1.2" | |
} | |
, "devDependencies" : { | |
"npm" : "latest" | |
} | |
, "scripts" : { | |
"start" : "coffee app.coffee" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var npm = require('npm') | |
var conf = {} | |
npm.load(conf, function (er) { | |
if (er) return handlError(er); | |
npm.commands.start([], function (er, data) { | |
if (er) return commandFailed(er); | |
}); | |
npm.on("log", function (message) { | |
}) | |
} | |
) | |
function commandFailed(er){ | |
console.log(er); | |
} | |
function handleError(er){ | |
console.log(er); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment