bin-links

WebJar for bin-links

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

bin-links
Last Version

Last Version

2.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

bin-links
WebJar for bin-links
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/npm/bin-links

Download bin-links

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/bin-links/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>bin-links</artifactId>
    <version>2.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/bin-links/
implementation 'org.webjars.npm:bin-links:2.2.1'
// https://jarcasting.com/artifacts/org.webjars.npm/bin-links/
implementation ("org.webjars.npm:bin-links:2.2.1")
'org.webjars.npm:bin-links:jar:2.2.1'
<dependency org="org.webjars.npm" name="bin-links" rev="2.2.1">
  <artifact name="bin-links" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='bin-links', version='2.2.1')
)
libraryDependencies += "org.webjars.npm" % "bin-links" % "2.2.1"
[org.webjars.npm/bin-links "2.2.1"]

Dependencies

compile (6)

Group / Artifact Type Version
org.webjars.npm : rimraf jar [3.0.0,4)
org.webjars.npm : read-cmd-shim jar [2.0.0,3)
org.webjars.npm : mkdirp jar [1.0.3,2)
org.webjars.npm : cmd-shim jar [4.0.1,5)
org.webjars.npm : npm-normalize-package-bin jar [1.0.0,2)
org.webjars.npm : write-file-atomic jar [3.0.3,4)

Project Modules

There are no modules declared in this project.

bin-links npm version license Travis AppVeyor Coverage Status

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'),

  // true if it's a global install, false for local.  default: false
  global: true,

  // true if it's the top level package being installed, false otherwise
  top: true,

  // true if you'd like to recklessly overwrite files.
  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.

> binLinks.getPaths({path, pkg, global, top })

Returns an array of all the paths of links and shims that might be created (assuming that they exist!) for the package at the specified path.

Does not touch the filesystem.

> binLinks.checkBins({path, pkg, global, top, force })

Checks if there are any conflicting bins which will prevent the linking of bins for the given package. Returns a Promise that resolves with no value if the way is clear, and rejects if there's something in the way.

Always returns successfully if global or top are false, or if force is true, or if the pkg object does not contain any bins to link.

Note that changes to the file system may still cause the binLinks method to fail even if this method succeeds. Does not check for conflicting man links.

Reads from the filesystem but does not make any changes.

Example
binLinks({path, pkg, force, global, top}).then(() => console.log('bins linked!'))
org.webjars.npm

npm

node package manager

Versions

Version
2.2.1
1.1.8
1.1.3
1.1.2
1.1.0