{"id":15365619,"url":"https://github.com/tunnckocore/is-installed","last_synced_at":"2025-04-15T09:52:54.764Z","repository":{"id":30591357,"uuid":"34146485","full_name":"tunnckoCore/is-installed","owner":"tunnckoCore","description":"Checks that given package is installed locally or globally. Useful for robust resolving when you want some package - it will check first if it exists locally, then if it exists globally","archived":false,"fork":false,"pushed_at":"2023-01-12T04:25:31.000Z","size":409,"stargazers_count":5,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T07:42:53.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://j.mp/1JVbpJZ","language":"JavaScript","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/tunnckoCore.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"tunnckoCore","custom":["https://gumroad.com/l/tunnckoCoreRecurringDonation"]}},"created_at":"2015-04-18T00:34:00.000Z","updated_at":"2020-01-06T23:52:58.000Z","dependencies_parsed_at":"2023-01-14T17:16:52.210Z","dependency_job_id":null,"html_url":"https://github.com/tunnckoCore/is-installed","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fis-installed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fis-installed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fis-installed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fis-installed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tunnckoCore","download_url":"https://codeload.github.com/tunnckoCore/is-installed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048713,"owners_count":21204305,"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-01T13:15:19.050Z","updated_at":"2025-04-15T09:52:54.744Z","avatar_url":"https://github.com/tunnckoCore.png","language":"JavaScript","funding_links":["https://ko-fi.com/tunnckoCore","https://gumroad.com/l/tunnckoCoreRecurringDonation"],"categories":[],"sub_categories":[],"readme":"# is-installed [![NPM version](https://img.shields.io/npm/v/is-installed.svg?style=flat)](https://www.npmjs.com/package/is-installed) [![NPM downloads](https://img.shields.io/npm/dm/is-installed.svg?style=flat)](https://npmjs.org/package/is-installed) [![npm total downloads][downloads-img]][downloads-url]\n\n\u003e Checks that given package is installed locally or globally. Useful for robust resolving when you want some package - it will check first if it exists locally, then if it exists globally\n\n[![code climate][codeclimate-img]][codeclimate-url] \n[![standard code style][standard-img]][standard-url] \n[![linux build status][travis-img]][travis-url] \n[![windows build status][appveyor-img]][appveyor-url] \n[![coverage status][coveralls-img]][coveralls-url] \n[![dependency status][david-img]][david-url]\n\nYou might also be interested in [get-installed-path](https://github.com/tunnckocore/get-installed-path#readme).\n\n## Table of Contents\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n  * [isInstalled](#isinstalled)\n  * [.sync](#sync)\n- [Related](#related)\n- [Contributing](#contributing)\n- [Building docs](#building-docs)\n- [Running tests](#running-tests)\n- [Author](#author)\n- [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## Install\nInstall with [npm](https://www.npmjs.com/)\n\n```\n$ npm install is-installed --save\n```\n\nor install using [yarn](https://yarnpkg.com)\n\n```\n$ yarn add is-installed\n```\n\n## Usage\n\u003e For more use-cases see the [tests](test.js)\n\n```js\nconst isInstalled = require('is-installed')\n```\n\n## API\n\n### [isInstalled](index.js#L42)\n\u003e Check if given `name` package is installed locally, then checks if it exists globally, using [detect-installed][] and so [global-modules][] (which in turn rely on [global-prefix][]). Windows bugs comes from [global-prefix][].\n\n**Params**\n\n* `name` **{String}**: package name    \n* `returns` **{Promise}**: resolved promise with boolean value  \n\n**Example**\n\n```js\nconst isInstalled = require('is-installed')\n\nisInstalled('npm').then((exists) =\u003e {\n  console.log(exists) // =\u003e true\n})\n\n// installed locally for this package\nisInstalled('detect-installed').then((exists) =\u003e {\n  console.log(exists) // =\u003e true\n})\n\nisInstalled('foo-bar-baz-qux').then((exists) =\u003e {\n  console.log(exists) // =\u003e false\n})\n```\n\n### [.sync](index.js#L68)\n\u003e Synchronously check if package `name` is installed.\n\n**Params**\n\n* `name` **{String}**: package name    \n* `returns` **{Boolean}**: always boolean `true` or `false`  \n\n**Example**\n\n```js\nconst isInstalled = require('is-installed')\n\nconst npmExists = isInstalled.sync('npm')\nconsole.log(npmExists) // =\u003e true\n\nconst notExists = isInstalled.sync('foo-abra-fsddsfsd-fsdf')\nconsole.log(notExists) // =\u003e false\n```\n\n## Related\n- [always-done](https://www.npmjs.com/package/always-done): Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement… [more](https://github.com/hybridables/always-done#readme) | [homepage](https://github.com/hybridables/always-done#readme \"Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement for [async-done][] - pass 100% of its tests plus more\")\n- [detect-installed](https://www.npmjs.com/package/detect-installed): Checks that given package is installed globally or locally. | [homepage](https://github.com/tunnckocore/detect-installed#readme \"Checks that given package is installed globally or locally.\")\n- [get-installed-path](https://www.npmjs.com/package/get-installed-path): Get locally or globally installation path of given package name | [homepage](https://github.com/tunnckocore/get-installed-path#readme \"Get locally or globally installation path of given package name\")\n- [global-modules](https://www.npmjs.com/package/global-modules): The directory used by npm for globally installed npm modules. | [homepage](https://github.com/jonschlinkert/global-modules \"The directory used by npm for globally installed npm modules.\")\n- [global-paths](https://www.npmjs.com/package/global-paths): Returns an array of unique \"global\" directories based on the user's platform and environment. The resulting paths can be used… [more](https://github.com/jonschlinkert/global-paths) | [homepage](https://github.com/jonschlinkert/global-paths \"Returns an array of unique \"global\" directories based on the user's platform and environment. The resulting paths can be used for doing lookups for generators or other globally installed npm packages. Node.js / JavaScript.\")\n- [global-prefix](https://www.npmjs.com/package/global-prefix): Get the npm global path prefix. | [homepage](https://github.com/jonschlinkert/global-prefix \"Get the npm global path prefix.\")\n- [minibase](https://www.npmjs.com/package/minibase): Minimalist alternative for Base. Build complex APIs with small units called plugins. Works well with most of the already existing… [more](https://github.com/node-minibase/minibase#readme) | [homepage](https://github.com/node-minibase/minibase#readme \"Minimalist alternative for Base. Build complex APIs with small units called plugins. Works well with most of the already existing [base][] plugins.\")\n- [try-catch-core](https://www.npmjs.com/package/try-catch-core): Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and… [more](https://github.com/hybridables/try-catch-core#readme) | [homepage](https://github.com/hybridables/try-catch-core#readme \"Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and used in higher-level libs such as [always-done][] to handle completion of anything.\")\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/is-installed/issues/new).  \nPlease read the [contributing guidelines](CONTRIBUTING.md) for advice on opening issues, pull requests, and coding standards.  \nIf you need some help and can spent some cash, feel free to [contact me at CodeMentor.io](https://www.codementor.io/tunnckocore?utm_source=github\u0026utm_medium=button\u0026utm_term=tunnckocore\u0026utm_campaign=github) too.\n\n**In short:** If you want to contribute to that project, please follow these things\n\n1. Please DO NOT edit [README.md](README.md), [CHANGELOG.md](CHANGELOG.md) and [.verb.md](.verb.md) files. See [\"Building docs\"](#building-docs) section.\n2. Ensure anything is okey by installing the dependencies and run the tests. See [\"Running tests\"](#running-tests) section.\n3. Always use `npm run commit` to commit changes instead of `git commit`, because it is interactive and user-friendly. It uses [commitizen][] behind the scenes, which follows Conventional Changelog idealogy.\n4. Do NOT bump the version in package.json. For that we use `npm run release`, which is [standard-version][] and follows Conventional Changelog idealogy.\n\nThanks a lot! :)\n\n## Building docs\nDocumentation and that readme is generated using [verb-generate-readme][], which is a [verb][] generator, so you need to install both of them and then run `verb` command like that\n\n```\n$ npm install verbose/verb#dev verb-generate-readme --global \u0026\u0026 verb\n```\n\n_Please don't edit the README directly. Any changes to the readme must be made in [.verb.md](.verb.md)._\n\n## Running tests\nClone repository and run the following in that cloned directory\n\n```\n$ npm install \u0026\u0026 npm test\n```\n\n## Author\n**Charlike Mike Reagent**\n\n+ [github/tunnckoCore](https://github.com/tunnckoCore)\n+ [twitter/tunnckoCore](http://twitter.com/tunnckoCore)\n+ [codementor/tunnckoCore](https://codementor.io/tunnckoCore)\n\n## License\nCopyright © 2016, [Charlike Mike Reagent](http://i.am.charlike.online). Released 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.2.0, on December 11, 2016._  \n_Project scaffolded using [charlike][] cli._\n\n[always-done]: https://github.com/hybridables/always-done\n[async-done]: https://github.com/gulpjs/async-done\n[base]: https://github.com/node-base/base\n[charlike]: https://github.com/tunnckocore/charlike\n[commitizen]: https://github.com/commitizen/cz-cli\n[dezalgo]: https://github.com/npm/dezalgo\n[once]: https://github.com/isaacs/once\n[standard-version]: https://github.com/conventional-changelog/standard-version\n[verb-generate-readme]: https://github.com/verbose/verb-generate-readme\n[verb]: https://github.com/verbose/verb\n\n[downloads-url]: https://www.npmjs.com/package/is-installed\n[downloads-img]: https://img.shields.io/npm/dt/is-installed.svg\n\n[codeclimate-url]: https://codeclimate.com/github/tunnckoCore/is-installed\n[codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/is-installed.svg\n\n[travis-url]: https://travis-ci.org/tunnckoCore/is-installed\n[travis-img]: https://img.shields.io/travis/tunnckoCore/is-installed/master.svg?label=linux\n\n[appveyor-url]: https://ci.appveyor.com/project/tunnckoCore/is-installed\n[appveyor-img]: https://img.shields.io/appveyor/ci/tunnckoCore/is-installed/master.svg?label=windows\n\n[coveralls-url]: https://coveralls.io/r/tunnckoCore/is-installed\n[coveralls-img]: https://img.shields.io/coveralls/tunnckoCore/is-installed.svg\n\n[david-url]: https://david-dm.org/tunnckoCore/is-installed\n[david-img]: https://img.shields.io/david/tunnckoCore/is-installed.svg\n\n[standard-url]: https://github.com/feross/standard\n[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n\n[detect-installed]: https://github.com/tunnckocore/detect-installed\n[global-modules]: https://github.com/jonschlinkert/global-modules\n[global-prefix]: https://github.com/jonschlinkert/global-prefix","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fis-installed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftunnckocore%2Fis-installed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fis-installed/lists"}