node/deps/npm/node_modules/init-package-json/example/example-npm.js

12 lines
291 B
JavaScript
Raw Normal View History

2013-11-21 03:08:52 +08:00
var init = require('../init-package-json.js')
2012-07-14 02:40:38 +08:00
var dir = process.cwd()
var npm = require('npm')
2013-11-21 03:08:52 +08:00
2012-07-14 02:40:38 +08:00
npm.load(function (er, npm) {
if (er) throw er
2013-11-21 03:08:52 +08:00
init(dir, npm.config.get('init-module'), npm.config, function (er, data) {
2012-07-14 02:40:38 +08:00
if (er) throw er
console.log('written successfully')
})
})