GithubHelp home page GithubHelp logo

bin-links's Introduction

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.

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

bin-links's People

Contributors

isaacs avatar iarna avatar mikesherov avatar zkat avatar marcosscriven avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.