summaryrefslogtreecommitdiff
path: root/node_modules/pkginfo/examples
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/pkginfo/examples')
-rw-r--r--node_modules/pkginfo/examples/all-properties.js19
-rw-r--r--node_modules/pkginfo/examples/array-argument.js20
-rw-r--r--node_modules/pkginfo/examples/multiple-properties.js19
-rw-r--r--node_modules/pkginfo/examples/object-argument.js22
-rw-r--r--node_modules/pkginfo/examples/package.json10
-rw-r--r--node_modules/pkginfo/examples/single-property.js19
-rw-r--r--node_modules/pkginfo/examples/subdir/package.json11
-rw-r--r--node_modules/pkginfo/examples/target-dir.js20
8 files changed, 140 insertions, 0 deletions
diff --git a/node_modules/pkginfo/examples/all-properties.js b/node_modules/pkginfo/examples/all-properties.js
new file mode 100644
index 0000000..fd1d831
--- /dev/null
+++ b/node_modules/pkginfo/examples/all-properties.js
@@ -0,0 +1,19 @@
+/*
+ * all-properties.js: Sample of including all properties from a package.json file
+ *
+ * (C) 2011, Charlie Robbins
+ *
+ */
+
+var util = require('util'),
+ pkginfo = require('../lib/pkginfo')(module);
+
+exports.someFunction = function () {
+ console.log('some of your custom logic here');
+};
+
+console.log('Inspecting module:');
+console.dir(module.exports);
+
+console.log('\nAll exports exposed:');
+console.error(Object.keys(module.exports)); \ No newline at end of file
diff --git a/node_modules/pkginfo/examples/array-argument.js b/node_modules/pkginfo/examples/array-argument.js
new file mode 100644
index 0000000..b1b6848
--- /dev/null
+++ b/node_modules/pkginfo/examples/array-argument.js
@@ -0,0 +1,20 @@
+/*
+ * array-argument.js: Sample of including specific properties from a package.json file
+ * using Array argument syntax.
+ *
+ * (C) 2011, Charlie Robbins
+ *
+ */
+
+var util = require('util'),
+ pkginfo = require('../lib/pkginfo')(module, ['version', 'author']);
+
+exports.someFunction = function () {
+ console.log('some of your custom logic here');
+};
+
+console.log('Inspecting module:');
+console.dir(module.exports);
+
+console.log('\nAll exports exposed:');
+console.error(Object.keys(module.exports)); \ No newline at end of file
diff --git a/node_modules/pkginfo/examples/multiple-properties.js b/node_modules/pkginfo/examples/multiple-properties.js
new file mode 100644
index 0000000..b4b5fd6
--- /dev/null
+++ b/node_modules/pkginfo/examples/multiple-properties.js
@@ -0,0 +1,19 @@
+/*
+ * multiple-properties.js: Sample of including multiple properties from a package.json file
+ *
+ * (C) 2011, Charlie Robbins
+ *
+ */
+
+var util = require('util'),
+ pkginfo = require('../lib/pkginfo')(module, 'version', 'author');
+
+exports.someFunction = function () {
+ console.log('some of your custom logic here');
+};
+
+console.log('Inspecting module:');
+console.dir(module.exports);
+
+console.log('\nAll exports exposed:');
+console.error(Object.keys(module.exports)); \ No newline at end of file
diff --git a/node_modules/pkginfo/examples/object-argument.js b/node_modules/pkginfo/examples/object-argument.js
new file mode 100644
index 0000000..28420c8
--- /dev/null
+++ b/node_modules/pkginfo/examples/object-argument.js
@@ -0,0 +1,22 @@
+/*
+ * object-argument.js: Sample of including specific properties from a package.json file
+ * using Object argument syntax.
+ *
+ * (C) 2011, Charlie Robbins
+ *
+ */
+
+var util = require('util'),
+ pkginfo = require('../lib/pkginfo')(module, {
+ include: ['version', 'author']
+ });
+
+exports.someFunction = function () {
+ console.log('some of your custom logic here');
+};
+
+console.log('Inspecting module:');
+console.dir(module.exports);
+
+console.log('\nAll exports exposed:');
+console.error(Object.keys(module.exports)); \ No newline at end of file
diff --git a/node_modules/pkginfo/examples/package.json b/node_modules/pkginfo/examples/package.json
new file mode 100644
index 0000000..1f2f01c
--- /dev/null
+++ b/node_modules/pkginfo/examples/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "simple-app",
+ "description": "A test fixture for pkginfo",
+ "version": "0.1.0",
+ "author": "Charlie Robbins <charlie.robbins@gmail.com>",
+ "keywords": ["test", "fixture"],
+ "main": "./index.js",
+ "scripts": { "test": "vows test/*-test.js --spec" },
+ "engines": { "node": ">= 0.4.0" }
+}
diff --git a/node_modules/pkginfo/examples/single-property.js b/node_modules/pkginfo/examples/single-property.js
new file mode 100644
index 0000000..4f44561
--- /dev/null
+++ b/node_modules/pkginfo/examples/single-property.js
@@ -0,0 +1,19 @@
+/*
+ * single-property.js: Sample of including a single specific properties from a package.json file
+ *
+ * (C) 2011, Charlie Robbins
+ *
+ */
+
+var util = require('util'),
+ pkginfo = require('../lib/pkginfo')(module, 'version');
+
+exports.someFunction = function () {
+ console.log('some of your custom logic here');
+};
+
+console.log('Inspecting module:');
+console.dir(module.exports);
+
+console.log('\nAll exports exposed:');
+console.error(Object.keys(module.exports)); \ No newline at end of file
diff --git a/node_modules/pkginfo/examples/subdir/package.json b/node_modules/pkginfo/examples/subdir/package.json
new file mode 100644
index 0000000..aa85410
--- /dev/null
+++ b/node_modules/pkginfo/examples/subdir/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "simple-app-subdir",
+ "description": "A test fixture for pkginfo",
+ "version": "0.1.0",
+ "author": "Charlie Robbins <charlie.robbins@gmail.com>",
+ "keywords": ["test", "fixture"],
+ "main": "./index.js",
+ "scripts": { "test": "vows test/*-test.js --spec" },
+ "engines": { "node": ">= 0.4.0" },
+ "subdironly": "true"
+}
diff --git a/node_modules/pkginfo/examples/target-dir.js b/node_modules/pkginfo/examples/target-dir.js
new file mode 100644
index 0000000..88770e6
--- /dev/null
+++ b/node_modules/pkginfo/examples/target-dir.js
@@ -0,0 +1,20 @@
+/*
+ * multiple-properties.js: Sample of including multiple properties from a package.json file
+ *
+ * (C) 2011, Charlie Robbins
+ *
+ */
+
+var util = require('util'),
+ path = require('path'),
+ pkginfo = require('../lib/pkginfo')(module, { dir: path.resolve(__dirname, 'subdir' )});
+
+exports.someFunction = function () {
+ console.log('some of your custom logic here');
+};
+
+console.log('Inspecting module:');
+console.dir(module.exports);
+
+console.log('\nAll exports exposed:');
+console.error(Object.keys(module.exports)); \ No newline at end of file