{"_id":"module-details-from-path","_rev":"3821978","name":"module-details-from-path","description":"Resolve npm package details, like name and base path, given an absolute path to a file inside a package","dist-tags":{"latest":"1.0.4"},"maintainers":[{"name":"watson","email":""}],"time":{"modified":"2025-06-26T01:58:27.000Z","created":"2016-02-09T10:33:09.711Z","1.0.4":"2025-04-29T16:59:53.775Z","1.0.3":"2016-07-09T14:21:00.366Z","1.0.2":"2016-02-09T12:07:41.185Z","1.0.1":"2016-02-09T10:56:08.480Z","1.0.0":"2016-02-09T10:33:09.711Z"},"users":{},"author":{"name":"Thomas Watson","email":"w@tson.dk","url":"https://wa.tson.dk/"},"repository":{"type":"git","url":"git+https://github.com/watson/module-details-from-path.git"},"versions":{"1.0.4":{"name":"module-details-from-path","version":"1.0.4","description":"Resolve npm package details, like name and base path, given an absolute path to a file inside a package","main":"index.js","dependencies":{},"devDependencies":{"bench-node":"^0.5.4","standard":"^15.0.1","tape":"^4.6.0"},"scripts":{"bench":"node --allow-natives-syntax bench.js","lint":"standard","test":"standard && node test.js","test:ci":"node test.js"},"repository":{"type":"git","url":"git+https://github.com/watson/module-details-from-path.git"},"keywords":["node","nodejs","npm","module","package","extract","parse","name","basedir","directory","path","relative"],"author":{"name":"Thomas Watson","email":"w@tson.dk","url":"https://wa.tson.dk/"},"license":"MIT","bugs":{"url":"https://github.com/watson/module-details-from-path/issues"},"homepage":"https://github.com/watson/module-details-from-path#readme","coordinates":[55.666507,12.5798711],"_id":"module-details-from-path@1.0.4","gitHead":"a7df269d5eb0803bb26ab61cb486f7c1fb4fad9c","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"shasum":"b662fdcd93f6c83d3f25289da0ce81c8d9685b94","size":1961,"noattachment":false,"key":"/module-details-from-path/-/module-details-from-path-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/module-details-from-path/download/module-details-from-path-1.0.4.tgz"},"_npmUser":{"name":"watson","email":"w@tson.dk"},"directories":{},"maintainers":[{"name":"watson","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/module-details-from-path_1.0.4_1745945993545_0.3113631506706067"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-04-29T16:59:53.775Z","publish_time":1745945993775,"_source_registry_name":"default","_cnpm_publish_time":1745945993775},"1.0.3":{"name":"module-details-from-path","version":"1.0.3","description":"Extract the Node.js module details like name and base path given an abosulte path to a file inside the module","main":"index.js","dependencies":{},"devDependencies":{"standard":"^7.1.2","tape":"^4.6.0"},"scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/watson/module-details-from-path.git"},"keywords":["node","nodejs","npm","module","extract","parse","name","basedir","directory","path","relative"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk","url":"https://twitter.com/wa7son"},"license":"MIT","bugs":{"url":"https://github.com/watson/module-details-from-path/issues"},"homepage":"https://github.com/watson/module-details-from-path#readme","coordinates":[55.666507,12.5798711],"gitHead":"6b231a35fae6b7f5b6b12b55fbb75fd4913afe5a","_id":"module-details-from-path@1.0.3","_shasum":"114c949673e2a8a35e9d35788527aa37b679da2b","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":""}],"dist":{"shasum":"114c949673e2a8a35e9d35788527aa37b679da2b","size":2194,"noattachment":false,"key":"/module-details-from-path/-/module-details-from-path-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/module-details-from-path/download/module-details-from-path-1.0.3.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/module-details-from-path-1.0.3.tgz_1468074058960_0.0820276674348861"},"directories":{},"publish_time":1468074060366,"_hasShrinkwrap":false,"_cnpm_publish_time":1468074060366,"_cnpmcore_publish_time":"2021-12-16T19:41:10.455Z"},"1.0.2":{"name":"module-details-from-path","version":"1.0.2","description":"Extract the Node.js module details like name and base path given an abosulte path to a file inside the module","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.4","tape":"^4.4.0"},"scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/watson/module-details-from-path.git"},"keywords":["node","nodejs","npm","module","extract","parse","name","basedir","directory","path","relative"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk","url":"https://twitter.com/wa7son"},"license":"MIT","bugs":{"url":"https://github.com/watson/module-details-from-path/issues"},"homepage":"https://github.com/watson/module-details-from-path#readme","coordinates":[55.6665316,12.5802111],"gitHead":"825df40c839530ac374bb416f354bd2613ed0130","_id":"module-details-from-path@1.0.2","_shasum":"742c057e247693d6736f19d00d79580e5c0bb560","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":""}],"dist":{"shasum":"742c057e247693d6736f19d00d79580e5c0bb560","size":2117,"noattachment":false,"key":"/module-details-from-path/-/module-details-from-path-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/module-details-from-path/download/module-details-from-path-1.0.2.tgz"},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/module-details-from-path-1.0.2.tgz_1455019658355_0.7972114481963217"},"directories":{},"publish_time":1455019661185,"_hasShrinkwrap":false,"_cnpm_publish_time":1455019661185,"_cnpmcore_publish_time":"2021-12-16T19:41:10.684Z"},"1.0.1":{"name":"module-details-from-path","version":"1.0.1","description":"Extract the Node.js module details like name and base path given an abosulte path to a file inside the module","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.4","tape":"^4.4.0"},"scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/watson/module-details-from-path.git"},"keywords":["node","nodejs","npm","module","extract","parse","name","basedir","directory","path","relative"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk","url":"https://twitter.com/wa7son"},"license":"MIT","bugs":{"url":"https://github.com/watson/module-details-from-path/issues"},"homepage":"https://github.com/watson/module-details-from-path#readme","coordinates":[55.6665681,12.5800787],"gitHead":"6664b90a43bf1beb9e4770992ac13d17ed5a66f5","_id":"module-details-from-path@1.0.1","_shasum":"3af40936eae5b87a9a37ead0a2ad77da54649c8c","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":""}],"dist":{"shasum":"3af40936eae5b87a9a37ead0a2ad77da54649c8c","size":2108,"noattachment":false,"key":"/module-details-from-path/-/module-details-from-path-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/module-details-from-path/download/module-details-from-path-1.0.1.tgz"},"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/module-details-from-path-1.0.1.tgz_1455015365648_0.9046150476206094"},"directories":{},"publish_time":1455015368480,"_hasShrinkwrap":false,"_cnpm_publish_time":1455015368480,"_cnpmcore_publish_time":"2021-12-16T19:41:11.217Z"},"1.0.0":{"name":"module-details-from-path","version":"1.0.0","description":"Extract the Node.js module details like name and base path given an abosulte path to a file inside the module","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.4"},"scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/watson/module-details-from-path.git"},"keywords":["node","nodejs","npm","module","extract","parse","name","basedir","directory","path","relative"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk","url":"https://twitter.com/wa7son"},"license":"MIT","bugs":{"url":"https://github.com/watson/module-details-from-path/issues"},"homepage":"https://github.com/watson/module-details-from-path#readme","coordinates":[55.6665739,12.5800608],"gitHead":"275d823a5905e659dec5f5bdde225ccd0c5d5da3","_id":"module-details-from-path@1.0.0","_shasum":"6f6916095ce642f34b86cf3dcaecfdf7d5e4d202","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":""}],"dist":{"shasum":"6f6916095ce642f34b86cf3dcaecfdf7d5e4d202","size":2064,"noattachment":false,"key":"/module-details-from-path/-/module-details-from-path-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/module-details-from-path/download/module-details-from-path-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/module-details-from-path-1.0.0.tgz_1455013986779_0.4744950954336673"},"directories":{},"publish_time":1455013989711,"_hasShrinkwrap":false,"_cnpm_publish_time":1455013989711,"_cnpmcore_publish_time":"2021-12-16T19:41:11.444Z"}},"readme":"# module-details-from-path\n\nResolve npm package details, like name and base path, given an absolute path to a file inside a package.\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\n## Installation\n\n```\nnpm install module-details-from-path --save\n```\n\n## Usage\n\n```js\nconst assert = require('assert')\nconst parse = require('module-details-from-path')\n\nconst path = '/Users/watson/code/node_modules/blackjack/node_modules/picture-tube/bin/tube.js'\n\nassert.deepStrictEqual(parse(path), {\n  name: 'picture-tube',\n  basedir: '/Users/watson/code/node_modules/blackjack/node_modules/picture-tube',\n  path: 'bin/tube.js'\n})\n```\n\nReturns `undefined` if module details cannot be found.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/watson/module-details-from-path#readme","bugs":{"url":"https://github.com/watson/module-details-from-path/issues"},"license":"MIT"}