{"_id":"load-module-pkg","_rev":"222056","name":"load-module-pkg","description":"Load the package.json for a module currently installed in node_modules, or at the given cwd.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T15:40:34.000Z","created":"2015-03-03T05:55:01.175Z","1.0.0":"2017-05-20T06:32:03.219Z","0.1.0":"2015-03-03T05:55:01.175Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/load-module-pkg.git"},"versions":{"1.0.0":{"name":"load-module-pkg","description":"Load the package.json for a module currently installed in node_modules, or at the given cwd.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/load-module-pkg","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/load-module-pkg.git"},"bugs":{"url":"https://github.com/jonschlinkert/load-module-pkg/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"expand-pkg":"^0.1.8","extend-shallow":"^2.0.1","resolve":"^1.3.3"},"devDependencies":{"gulp-format-md":"^0.1.12","kind-of":"^4.0.0","mocha":"^3.4.1","write-json":"^1.0.1"},"keywords":["dep","dependencies","dependency","json","load","module","modules","node","node-modules","package","package-json","pkg"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["find-pkg","load-pkg","find-file-up"]},"lint":{"reflinks":true},"reflinks":["expand-pkg","resolve"]},"gitHead":"39a1662d6c2d540a64539ffa674823be19cc8a48","_id":"load-module-pkg@1.0.0","_shasum":"42b72fa6393774b7ee2071017884d50273d341a2","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"42b72fa6393774b7ee2071017884d50273d341a2","size":3452,"noattachment":false,"key":"/load-module-pkg/-/load-module-pkg-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/load-module-pkg/download/load-module-pkg-1.0.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/load-module-pkg-1.0.0.tgz_1495261922152_0.3839378587435931"},"directories":{},"publish_time":1495261923219,"_hasShrinkwrap":false,"_cnpm_publish_time":1495261923219},"0.1.0":{"name":"load-module-pkg","description":"Load the package.json for any project currently installed in node_modules.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/load-module-pkg","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/load-module-pkg.git"},"bugs":{"url":"https://github.com/jonschlinkert/load-module-pkg/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/load-module-pkg/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"cwd":"^0.5.0"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["dep","dependencies","dependency","json","module","modules","node","node-modules","package","package-json","pkg"],"_id":"load-module-pkg@0.1.0","_shasum":"2d0dfa57c258b4d115fc728cb5404ee79301889d","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"2d0dfa57c258b4d115fc728cb5404ee79301889d","size":2153,"noattachment":false,"key":"/load-module-pkg/-/load-module-pkg-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/load-module-pkg/download/load-module-pkg-0.1.0.tgz"},"directories":{},"publish_time":1425362101175,"_cnpm_publish_time":1425362101175,"_hasShrinkwrap":false}},"readme":"# load-module-pkg [![NPM version](https://img.shields.io/npm/v/load-module-pkg.svg?style=flat)](https://www.npmjs.com/package/load-module-pkg) [![NPM monthly downloads](https://img.shields.io/npm/dm/load-module-pkg.svg?style=flat)](https://npmjs.org/package/load-module-pkg) [![NPM total downloads](https://img.shields.io/npm/dt/load-module-pkg.svg?style=flat)](https://npmjs.org/package/load-module-pkg) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/load-module-pkg.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/load-module-pkg)\n\n> Load the package.json for a module currently installed in node_modules, or at the given cwd.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save load-module-pkg\n```\n\n## Usage\n\n```js\nvar load = require('load-module-pkg');\n```\n\n### async\n\n```js\nload('kind-of', function(err, pkg) {\n  if (err) throw err;\n  console.log(pkg.name);\n  //=> 'kind-of'\n});\n\n// load package.json from cwd\nload('.', function(err, pkg) {\n  if (err) throw err;\n  console.log(pkg.name);\n  //=> 'load-module-pkg'\n});\n```\n\n### sync\n\n```js\nvar pkg = load.sync('kind-of');\nconsole.log(pkg.name);\n//=> 'kind-of'\n\nvar pkg = load.sync('./foo', {cwd: 'bar'});\nconsole.log(pkg.name);\n//=> 'my-module'\n```\n\n## Options\n\nAll options are passed to [resolve](https://github.com/substack/node-resolve), see the resolve docs for all available options and features.\n\n### options.cwd\n\n**Type**: `string`\n\n**Default**: `undefined`\n\nAlias for the `basedir` option passed to [resolve](https://github.com/substack/node-resolve).\n\nAdditionally, `process.cwd()` is used as `basedir` _if the module name does not begin with `.` and `basedir` is undefined_.\n\n### options.expand\n\n**Type**: `boolean`\n\n**Default**: `true`\n\nBy default, values in the resolved package.json are [normalized and expanded](https://github.com/jonschlinkert/expand-pkg). Where applicable, this converts string values (like `author` and `repository`) into objects, and adds missing properties when possible (like `homepage` if the `repository.url` can be used), making the data easier to use in other applications.\n\nYou can disable this by setting this option to false:\n\n```js\nvar load = require('load-module-pkg');\n\nvar pkg = load.sync('mocha');\nconsole.log(pkg.repository.url);\n//=> git+https://github.com/mochajs/mocha.git\nconsole.log(pkg.href);\n//=> https://github.com/mochajs/mocha\n\nvar pkg = load.sync('mocha', {expand: false});\nconsole.log(pkg.repository.url);\n//=> git+https://github.com/mochajs/mocha.git\nconsole.log(pkg.href);\n//=> undefined\n```\n\nSee [expand-pkg](https://github.com/jonschlinkert/expand-pkg) to learn more about how values are expanded.\n\n## About\n\n### Related projects\n\n* [find-file-up](https://www.npmjs.com/package/find-file-up): Find a file, starting with the given cwd and recursively searching up one directory until… [more](https://github.com/jonschlinkert/find-file-up) | [homepage](https://github.com/jonschlinkert/find-file-up \"Find a file, starting with the given cwd and recursively searching up one directory until it's found (or we run out of directories). Async and sync.\")\n* [find-pkg](https://www.npmjs.com/package/find-pkg): Find the first directory with a package.json, recursing up, starting with the given directory. Similar… [more](https://github.com/jonschlinkert/find-pkg) | [homepage](https://github.com/jonschlinkert/find-pkg \"Find the first directory with a package.json, recursing up, starting with the given directory. Similar to look-up but does not support globs and only searches for package.json. Async and sync.\")\n* [load-pkg](https://www.npmjs.com/package/load-pkg): Loads the package.json from the root of the user's current project. | [homepage](https://github.com/jonschlinkert/load-pkg \"Loads the package.json from the root of the user's current project.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 20, 2017._","_attachments":{},"homepage":"https://github.com/jonschlinkert/load-module-pkg","bugs":{"url":"https://github.com/jonschlinkert/load-module-pkg/issues"},"license":"MIT"}