bin-links
bin-links
is a standalone library that links
binaries and man pages for Javascript packages
Install
$ npm install bin-links
Table of Contents
Example
const binLinks = require('bin-links')
const readPackageJson = require('read-package-json-fast')
binLinks({
path: '/path/to/node_modules/some-package',
pkg: readPackageJson('/path/to/node_modules/some-package/package.json'),
global: true,
top: true,
force: true,
})
Features
- Links bin files listed under the
bin
property of pkg to the
node_modules/.bin
directory of the installing environment. (Or
${prefix}/bin
for top level global packages on unix, and ${prefix}
for top level global packages on Windows.) - Links man files listed under the
man
property of pkg to the share/man
directory. (This is only done for top-level global packages on Unix
systems.)
Contributing
The npm team enthusiastically welcomes contributions and project participation!
There's a bunch of things you can do if you want to contribute! The Contributor
Guide has all the information you need for everything from
reporting bugs to contributing entire new features. Please don't hesitate to
jump in if you'd like to, or even ask us questions if something isn't clear.
API
> binLinks({path, pkg, force, global, top})
Returns a Promise that resolves when the requisite things have been linked.
Example
binLinks({path, pkg, force, global, top}).then(() => console.log('bins linked!'))