Giter Club home page Giter Club logo

libnpmexec's Introduction

libnpmexec

npm version license GitHub Actions Coverage Status

The npm exec (npx) Programmatic API

Install

npm install libnpmexec

Usage:

const libexec = require('libnpmexec')
await libexec({
  args: ['yosay', 'Bom dia!'],
  cache: '~/.npm/_cacache',
  npxCache: '~/.npm/_npx',
  yes: true,
})

API:

libexec(opts)

  • opts:
    • args: List of pkgs to execute Array, defaults to []
    • call: An alternative command to run when using packages option String, defaults to empty string.
    • cache: The path location to where the npm cache folder is placed String
    • npxCache: The path location to where the npx cache folder is placed String
    • color: Output should use color? Boolean, defaults to false
    • localBin: Location to the node_modules/.bin folder of the local project to start scanning for bin files String, defaults to ./node_modules/.bin. libexec will walk up the directory structure looking for node_modules/.bin folders in parent folders that might satisfy the current arg and will use that bin if found.
    • locationMsg: Overrides "at location" message when entering interactive mode String
    • log: Sets an optional logger Object, defaults to proc-log module usage.
    • globalBin: Location to the global space bin folder, same as: $(npm bin -g) String, defaults to empty string.
    • output: A function to print output to Function
    • packages: A list of packages to be used (possibly fetch from the registry) Array, defaults to []
    • path: Location to where to read local project info (package.json) String, defaults to .
    • runPath: Location to where to execute the script String, defaults to .
    • scriptShell: Default shell to be used String, defaults to sh on POSIX systems, process.env.ComSpec OR cmd on Windows
    • yes: Should skip download confirmation prompt when fetching missing packages from the registry? Boolean
    • registry, cache, and more options that are forwarded to @npmcli/arborist and pacote Object

LICENSE

ISC

libnpmexec's People

Contributors

ruyadorno avatar wraithgar avatar isaacs 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.