{"id":16327071,"url":"https://github.com/mrmlnc/npm-module-path","last_synced_at":"2025-05-14T22:33:14.373Z","repository":{"id":65369865,"uuid":"63602772","full_name":"mrmlnc/npm-module-path","owner":"mrmlnc","description":":package: Get the path of the given package(s) if it is installed globally or locally.","archived":false,"fork":false,"pushed_at":"2017-05-04T17:53:24.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T23:47:26.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrmlnc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-18T12:52:54.000Z","updated_at":"2016-12-10T14:02:16.000Z","dependencies_parsed_at":"2023-03-07T05:45:35.861Z","dependency_job_id":null,"html_url":"https://github.com/mrmlnc/npm-module-path","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmlnc%2Fnpm-module-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmlnc%2Fnpm-module-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmlnc%2Fnpm-module-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmlnc%2Fnpm-module-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrmlnc","download_url":"https://codeload.github.com/mrmlnc/npm-module-path/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254239820,"owners_count":22037773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T23:10:19.591Z","updated_at":"2025-05-14T22:33:13.942Z","avatar_url":"https://github.com/mrmlnc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm-module-path\n\n\u003e Get the path of the given package(s) if it is installed globally or locally.\n\n[![Travis Status](https://travis-ci.org/mrmlnc/npm-module-path.svg?branch=master)](https://travis-ci.org/mrmlnc/npm-module-path)\n[![AppVeyor status](https://ci.appveyor.com/api/projects/status/81n2iq2h2cyef8mf?svg=true)](https://ci.appveyor.com/project/mrmlnc/npm-module-path)\n\n## Install\n\n```shell\n$ npm i -S npm-module-path\n```\n\n## Why?\n\nPrimarily, this module is designed to search modules for VS Code (Language Server Extensions, etc).\n\n  * Dependencies free.\n  * Returns the path to the module directory (without `require`).\n  * Can work with an array of dependencies.\n\n## Usage\n\n```js\nconst nmp = require('npm-module-path');\n\nnmp.resolveOne('mocha').then((filepath) =\u003e {\n\tconsole.log(filepath); // ['/home/travis/.nvm/versions/node/v6.6.0/lib/node_modules/mocha']\n});\n\nnmp.resolveMany(['mocha', 'tslint']).then((filepaths) =\u003e {\n\tconsole.log(filepaths); // ['node_modules/mocha', '/usr/lib/node_modules/tslint']\n});\n```\n\n## resolveOne(toResolve: string, root?: string, options?: IResolveOptions)\n## resolveMany(toResolve: string[], root?: string, options?: IResolveOptions)\n\n## IResolveOptions\n\n**cache**\n\n  * Type: `String`\n  * Default: `.`\n\nThe root directory of the project to search the module.\n\n**resolveDir**\n\n  * Type: `Boolean`\n  * Default: `false`\n\nReturn the path to the directory where the module was found.\n\n**resolveOnlyByPrefix**\n\n  * Type: `Boolean`\n  * Default: `false`\n\nSkip search modules in the default directories and search them only by `npm config get prefix`.\n\n## Changelog\n\nSee the [Releases section of our GitHub project](https://github.com/mrmlnc/npm-module-path/releases) for changelogs for each release version.\n\n## License\n\nThis software is released under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrmlnc%2Fnpm-module-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrmlnc%2Fnpm-module-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrmlnc%2Fnpm-module-path/lists"}