Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-11-20 22:06:08 +0400
committerisaacs <i@izs.me>2013-11-20 22:06:42 +0400
commit9b3786dafd76f27bc07b85d6a7ade53720124e4b (patch)
tree4728e067b506e56984fad444903e5314bf2fe6c0 /node_modules/init-package-json/example/example-npm.js
parent1b2b78c06620ef8c65e90d6334d95e5c1a17a1b9 (diff)
init-package-json@0.0.13
Diffstat (limited to 'node_modules/init-package-json/example/example-npm.js')
-rw-r--r--node_modules/init-package-json/example/example-npm.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/node_modules/init-package-json/example/example-npm.js b/node_modules/init-package-json/example/example-npm.js
new file mode 100644
index 000000000..b394eeabc
--- /dev/null
+++ b/node_modules/init-package-json/example/example-npm.js
@@ -0,0 +1,13 @@
+var init = require('../init-package-json.js')
+var path = require('path')
+var dir = process.cwd()
+var npm = require('npm')
+
+npm.load(function (er, npm) {
+ if (er) throw er
+ init(dir, npm.config.get('init-module'), npm.config, function (er, data) {
+ if (er) throw er
+ console.log('written successfully')
+ })
+})
+