{"_id":"pkginfo","_rev":"113130","name":"pkginfo","description":"An easy way to expose properties on a module from a package.json","dist-tags":{"latest":"0.4.1"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"}],"time":{"modified":"2021-06-03T10:45:39.000Z","created":"2011-06-08T09:38:59.614Z","0.4.1":"2017-08-23T03:55:22.290Z","0.4.0":"2016-03-02T03:20:23.448Z","0.3.1":"2015-10-20T14:54:28.048Z","0.3.0":"2013-01-18T06:59:12.201Z","0.2.3":"2011-12-08T23:50:52.279Z","0.2.2":"2011-07-13T21:42:39.570Z","0.2.1":"2011-06-08T09:38:59.614Z"},"users":{"luuse":true,"fgribreau":true,"mehrshad":true,"stdarg":true,"kahboom":true,"iamveen":true,"pstoev":true,"mrmartineau":true,"stoneren":true,"loselovegirl":true,"recursion_excursion":true,"demiurgosoft":true,"roccomuso":true,"aquiandres":true,"yabasha":true,"joaquin.briceno":true,"dm7":true,"cbetancourt":true,"l8niteowl":true,"xiaobing":true},"author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/indexzero/node-pkginfo.git"},"versions":{"0.4.1":{"name":"pkginfo","version":"0.4.1","license":"MIT","description":"An easy way to expose properties on a module from a package.json","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/indexzero/node-pkginfo.git"},"bugs":{"url":"https://github.com/indexzero/node-pkginfo/issues"},"keywords":["info","tools","package.json"],"devDependencies":{"vows":"0.8.0"},"main":"./lib/pkginfo.js","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"gitHead":"f4e90ac77034ee9eb3dd7aafc56657d7376795a8","homepage":"https://github.com/indexzero/node-pkginfo#readme","_id":"pkginfo@0.4.1","_shasum":"b5418ef0439de5425fc4995042dced14fb2a84ff","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"}],"dist":{"shasum":"b5418ef0439de5425fc4995042dced14fb2a84ff","size":4356,"noattachment":false,"key":"/pkginfo/-/pkginfo-0.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkginfo/download/pkginfo-0.4.1.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pkginfo-0.4.1.tgz_1503460521335_0.48146630520932376"},"directories":{},"publish_time":1503460522290,"_cnpm_publish_time":1503460522290,"_hasShrinkwrap":false},"0.4.0":{"name":"pkginfo","version":"0.4.0","license":"MIT","description":"An easy way to expose properties on a module from a package.json","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/indexzero/node-pkginfo.git"},"bugs":{"url":"https://github.com/indexzero/node-pkginfo/issues"},"keywords":["info","tools","package.json"],"devDependencies":{"vows":"0.8.0"},"main":"./lib/pkginfo.js","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"gitHead":"f0cc3fa9d45413bdabd2d160bb0dbe03e2d04870","homepage":"https://github.com/indexzero/node-pkginfo#readme","_id":"pkginfo@0.4.0","_shasum":"349dbb7ffd38081fcadc0853df687f0c7744cd65","_from":".","_npmVersion":"3.7.3","_nodeVersion":"4.2.2","_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"}],"dist":{"shasum":"349dbb7ffd38081fcadc0853df687f0c7744cd65","size":9774,"noattachment":false,"key":"/pkginfo/-/pkginfo-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkginfo/download/pkginfo-0.4.0.tgz"},"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/pkginfo-0.4.0.tgz_1456888821214_0.3420205994043499"},"directories":{},"publish_time":1456888823448,"_cnpm_publish_time":1456888823448,"_hasShrinkwrap":false},"0.3.1":{"name":"pkginfo","version":"0.3.1","license":"MIT","description":"An easy way to expose properties on a module from a package.json","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/indexzero/node-pkginfo.git"},"bugs":{"url":"https://github.com/indexzero/node-pkginfo/issues"},"keywords":["info","tools","package.json"],"devDependencies":{"vows":"0.7.x"},"main":"./lib/pkginfo.js","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"gitHead":"630fcf486543ee48b4c16afc575c0421fe039f26","homepage":"https://github.com/indexzero/node-pkginfo#readme","_id":"pkginfo@0.3.1","_shasum":"5b29f6a81f70717142e09e765bbeab97b4f81e21","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.10.38","_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"}],"dist":{"shasum":"5b29f6a81f70717142e09e765bbeab97b4f81e21","size":7969,"noattachment":false,"key":"/pkginfo/-/pkginfo-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkginfo/download/pkginfo-0.3.1.tgz"},"directories":{},"publish_time":1445352868048,"_cnpm_publish_time":1445352868048,"_hasShrinkwrap":false},"0.3.0":{"name":"pkginfo","version":"0.3.0","description":"An easy way to expose properties on a module from a package.json","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"http://github.com/indexzero/node-pkginfo.git"},"keywords":["info","tools","package.json"],"devDependencies":{"vows":"0.7.x"},"main":"./lib/pkginfo","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"readmeFilename":"README.md","_id":"pkginfo@0.3.0","dist":{"shasum":"726411401039fe9b009eea86614295d5f3a54276","size":7961,"noattachment":false,"key":"/pkginfo/-/pkginfo-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkginfo/download/pkginfo-0.3.0.tgz"},"_npmVersion":"1.1.66","_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"}],"directories":{},"publish_time":1358492352201,"_hasShrinkwrap":false,"_cnpm_publish_time":1358492352201},"0.2.3":{"name":"pkginfo","version":"0.2.3","description":"An easy way to expose properties on a module from a package.json","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"git://github.com/indexzero/node-pkginfo.git"},"keywords":["info","tools","package.json"],"devDependencies":{"vows":"0.6.x"},"main":"./lib/pkginfo","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"_id":"pkginfo@0.2.3","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"7239c42a5ef6c30b8f328439d9b9ff71042490f8","size":10240,"noattachment":false,"key":"/pkginfo/-/pkginfo-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkginfo/download/pkginfo-0.2.3.tgz"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"}],"directories":{},"publish_time":1323388252279,"_hasShrinkwrap":false,"_cnpm_publish_time":1323388252279},"0.2.2":{"name":"pkginfo","version":"0.2.2","description":"An easy way to expose properties on a module from a package.json","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"git://github.com/indexzero/pkginfo.git"},"keywords":["info","tools","package.json"],"devDependencies":{"vows":"0.5.x"},"main":"./lib/pkginfo","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/Charlie/.npm/pkginfo/0.2.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"pkginfo@0.2.2","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"97e1100dbbb275ff6fab583a256a7eea85120c8e","size":7170,"noattachment":false,"key":"/pkginfo/-/pkginfo-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkginfo/download/pkginfo-0.2.2.tgz"},"directories":{},"publish_time":1310593359570,"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1310593359570},"0.2.1":{"name":"pkginfo","version":"0.2.1","description":"An easy way to expose properties on a module from a package.json","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"git://github.com/indexzero/pkginfo.git"},"keywords":["info","tools","package.json"],"devDependencies":{"vows":"0.5.x"},"main":"./lib/pkginfo","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_id":"pkginfo@0.2.1","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"40fd285c83b52dbd549fbd633c154607fe38fc89","size":11991,"noattachment":false,"key":"/pkginfo/-/pkginfo-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkginfo/download/pkginfo-0.2.1.tgz"},"directories":{},"publish_time":1307525939614,"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1307525939614}},"readme":"# node-pkginfo\n\nAn easy way to expose properties on a module from a package.json\n\n### Installing pkginfo\n```\n  npm install pkginfo\n```\n\n## Motivation\nHow often when writing node.js modules have you written the following line(s) of code?\n\n* Hard code your version string into your code\n\n``` js\n  exports.version = '0.1.0';\n```\n\n* Programmatically expose the version from the package.json\n\n``` js\n  exports.version = require('/path/to/package.json').version;\n```\n\nIn other words, how often have you wanted to expose basic information from your package.json onto your module programmatically? **WELL NOW YOU CAN!**\n\n## Usage\n\nUsing `pkginfo` is idiot-proof, just require and invoke it.\n\n``` js\n  var pkginfo = require('pkginfo')(module);\n\n  console.dir(module.exports);\n```\n\nBy invoking the `pkginfo` module all of the properties in your `package.json` file will be automatically exposed on the callee module (i.e. the parent module of `pkginfo`).\n\nHere's a sample of the output:\n\n```\n  { name: 'simple-app',\n    description: 'A test fixture for pkginfo',\n    version: '0.1.0',\n    author: 'Charlie Robbins <charlie.robbins@gmail.com>',\n    keywords: [ 'test', 'fixture' ],\n    main: './index.js',\n    scripts: { test: 'vows test/*-test.js --spec' },\n    engines: { node: '>= 0.4.0' } }\n```\n\n### Expose specific properties\nIf you don't want to expose **all** properties on from your `package.json` on your module then simple pass those properties to the `pkginfo` function:\n\n``` js\n  var pkginfo = require('pkginfo')(module, 'version', 'author');\n\n  console.dir(module.exports);\n```\n\n```\n  { version: '0.1.0',\n    author: 'Charlie Robbins <charlie.robbins@gmail.com>' }\n```\n\nIf you're looking for further usage see the [examples][0] included in this repository.\n\n## Run Tests\nTests are written in [vows][1] and give complete coverage of all APIs.\n\n```\n  npm install\n  npm test\n```\n\n[0]: https://github.com/indexzero/node-pkginfo/tree/master/examples\n[1]: http://vowsjs.org\n\n#### Author: [Charlie Robbins](http://github.com/indexzero)\n#### License: MIT\n","_attachments":{},"homepage":"https://github.com/indexzero/node-pkginfo#readme","bugs":{"url":"https://github.com/indexzero/node-pkginfo/issues"},"license":"MIT"}