Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
The bin-links npm package is a module that is responsible for linking binary files and commands for npm packages. It handles the creation of symlinks for executable files to the .bin directory within the node_modules folder or the global bin directory when a package is installed. This allows users to execute the binaries provided by the installed packages directly from the command line.
Linking Binaries
This feature allows the bin-links package to create symlinks for the binaries specified in the package.json file of a node module. The code sample demonstrates how to use bin-links to link binaries for a local package installation.
const binLinks = require('bin-links');
binLinks({
path: '/path/to/package',
pkg: { bin: { 'my-binary': './cli.js' } },
global: false,
force: true
}).then(() => {
console.log('Binaries linked successfully.');
}).catch((err) => {
console.error('Error linking binaries:', err);
});
Linking Global Binaries
This feature is similar to the previous one but is used for linking binaries globally. When the 'global' option is set to true, the binaries are linked in the global bin directory, making them accessible from anywhere in the system.
const binLinks = require('bin-links');
binLinks({
path: '/path/to/package',
pkg: { bin: { 'my-binary': './cli.js' } },
global: true,
force: true
}).then(() => {
console.log('Global binaries linked successfully.');
}).catch((err) => {
console.error('Error linking global binaries:', err);
});
The cmd-shim package is similar to bin-links in that it creates shim scripts for node modules to be used as command-line tools. Unlike bin-links, cmd-shim is focused on creating shims compatible with Windows as well as Unix systems.
npm-link is a package that provides functionality to symlink a package folder during development. While it serves a different purpose from bin-links, which links binaries, npm-link is used to link the entire package for development purposes.
bin-links
is a standalone library that links
binaries and man pages for Javascript packages
$ npm install bin-links
// todo
bin
property of pkg to the node_modules/.bin
directory of the installing environment.man
property of pkg to the share/man directory
of the provided optional directory prefix.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.
> binLinks(pkg, folder, global, opts, cb)
binLinks(pkg, folder, global, opts, cb)
FAQs
JavaScript package binary linker
The npm package bin-links receives a total of 1,274,131 weekly downloads. As such, bin-links popularity was classified as popular.
We found that bin-links demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.