{"id":15290166,"url":"https://github.com/npm/bin-links","last_synced_at":"2025-04-09T05:11:25.246Z","repository":{"id":25702088,"uuid":"103666531","full_name":"npm/bin-links","owner":"npm","description":".bin/ script linker","archived":false,"fork":false,"pushed_at":"2025-04-08T18:41:23.000Z","size":379,"stargazers_count":26,"open_issues_count":2,"forks_count":16,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-08T19:47:24.747Z","etag":null,"topics":["binary","links","npm","npm-cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-15T14:29:57.000Z","updated_at":"2025-04-08T18:41:25.000Z","dependencies_parsed_at":"2023-12-04T22:30:30.411Z","dependency_job_id":"be2693dc-b077-45b3-af9b-66f818f51c22","html_url":"https://github.com/npm/bin-links","commit_stats":{"total_commits":151,"total_committers":21,"mean_commits":7.190476190476191,"dds":0.7549668874172185,"last_synced_commit":"21614a8d3f0479136a76648e2f9364aad3ffdd55"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fbin-links","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fbin-links/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fbin-links/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fbin-links/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npm","download_url":"https://codeload.github.com/npm/bin-links/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247918929,"owners_count":21018043,"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":["binary","links","npm","npm-cli"],"created_at":"2024-09-30T16:05:58.106Z","updated_at":"2025-04-09T05:11:25.229Z","avatar_url":"https://github.com/npm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bin-links [![npm version](https://img.shields.io/npm/v/bin-links.svg)](https://npm.im/bin-links) [![license](https://img.shields.io/npm/l/bin-links.svg)](https://npm.im/bin-links) [![Travis](https://img.shields.io/travis/npm/bin-links.svg)](https://travis-ci.org/npm/bin-links) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/bin-links?svg=true)](https://ci.appveyor.com/project/npm/bin-links) [![Coverage Status](https://coveralls.io/repos/github/npm/bin-links/badge.svg?branch=latest)](https://coveralls.io/github/npm/bin-links?branch=latest)\n\n[`bin-links`](https://github.com/npm/bin-links) is a standalone library that links\nbinaries and man pages for JavaScript packages\n\n## Install\n\n`$ npm install bin-links`\n\n## Table of Contents\n\n* [Example](#example)\n* [Features](#features)\n* [Contributing](#contributing)\n* [API](#api)\n  * [`binLinks`](#binLinks)\n  * [`binLinks.getPaths()`](#getPaths)\n  * [`binLinks.checkBins()`](#checkBins)\n\n### Example\n\n```javascript\nconst binLinks = require('bin-links')\nconst readPackageJson = require('read-package-json-fast')\nbinLinks({\n  path: '/path/to/node_modules/some-package',\n  pkg: readPackageJson('/path/to/node_modules/some-package/package.json'),\n\n  // true if it's a global install, false for local.  default: false\n  global: true,\n\n  // true if it's the top level package being installed, false otherwise\n  top: true,\n\n  // true if you'd like to recklessly overwrite files.\n  force: true,\n})\n```\n\n### Features\n\n* Links bin files listed under the `bin` property of pkg to the\n  `node_modules/.bin` directory of the installing environment.  (Or\n  `${prefix}/bin` for top level global packages on unix, and `${prefix}`\n  for top level global packages on Windows.)\n* Links man files listed under the `man` property of pkg to the share/man\n  directory.  (This is only done for top-level global packages on Unix\n  systems.)\n\n### Contributing\n\nThe npm team enthusiastically welcomes contributions and project participation!\nThere's a bunch of things you can do if you want to contribute! The [Contributor\nGuide](CONTRIBUTING.md) has all the information you need for everything from\nreporting bugs to contributing entire new features. Please don't hesitate to\njump in if you'd like to, or even ask us questions if something isn't clear.\n\n### API\n\n#### \u003ca name=\"binLinks\"\u003e\u003c/a\u003e `\u003e binLinks({path, pkg, force, global, top})`\n\nReturns a Promise that resolves when the requisite things have been linked.\n\n#### \u003ca name=\"getPaths\"\u003e\u003c/a\u003e `\u003e binLinks.getPaths({path, pkg, global, top })`\n\nReturns an array of all the paths of links and shims that _might_ be\ncreated (assuming that they exist!) for the package at the specified path.\n\nDoes not touch the filesystem.\n\n#### \u003ca name=\"checkBins\"\u003e\u003c/a\u003e `\u003e binLinks.checkBins({path, pkg, global, top, force })`\n\nChecks if there are any conflicting bins which will prevent the linking of\nbins for the given package.  Returns a Promise that resolves with no value\nif the way is clear, and rejects if there's something in the way.\n\nAlways returns successfully if `global` or `top` are false, or if `force`\nis true, or if the `pkg` object does not contain any bins to link.\n\nNote that changes to the file system _may_ still cause the `binLinks`\nmethod to fail even if this method succeeds.  Does not check for\nconflicting `man` links.\n\nReads from the filesystem but does not make any changes.\n\n##### Example\n\n```javascript\nbinLinks({path, pkg, force, global, top}).then(() =\u003e console.log('bins linked!'))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Fbin-links","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm%2Fbin-links","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Fbin-links/lists"}