{"id":15290349,"url":"https://github.com/npm/libnpmexec","last_synced_at":"2025-10-07T03:33:07.803Z","repository":{"id":46559783,"uuid":"358368346","full_name":"npm/libnpmexec","owner":"npm","description":"npm exec (npx) Programmatic API","archived":true,"fork":false,"pushed_at":"2022-01-18T21:27:57.000Z","size":1375,"stargazers_count":33,"open_issues_count":1,"forks_count":5,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-10-01T16:07:08.393Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS.md","security":null,"support":null}},"created_at":"2021-04-15T19:19:52.000Z","updated_at":"2023-01-28T03:56:21.000Z","dependencies_parsed_at":"2022-09-05T16:51:40.682Z","dependency_job_id":null,"html_url":"https://github.com/npm/libnpmexec","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Flibnpmexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Flibnpmexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Flibnpmexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Flibnpmexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npm","download_url":"https://codeload.github.com/npm/libnpmexec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235586101,"owners_count":19014028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T16:07:20.019Z","updated_at":"2025-10-07T03:33:02.318Z","avatar_url":"https://github.com/npm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# We've Moved! 🚚\nThe code for this repo is now a workspace in the npm CLI repo.\n\n[github.com/npm/cli](https://github.com/npm/cli)\n\nYou can find the workspace in /workspaces/libnpmexec\n\nPlease file bugs and feature requests as issues on the CLI and tag the issue with \"ws:libnpmexec\".\n\n[github.com/npm/cli/issues](https://github.com/npm/cli)\n\n# libnpmexec\n\n[![npm version](https://img.shields.io/npm/v/libnpmexec.svg)](https://npm.im/libnpmexec)\n[![license](https://img.shields.io/npm/l/libnpmexec.svg)](https://npm.im/libnpmexec)\n[![GitHub Actions](https://github.com/npm/libnpmexec/workflows/node-ci/badge.svg)](https://github.com/npm/libnpmexec/actions?query=workflow%3Anode-ci)\n[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmexec/badge.svg?branch=main)](https://coveralls.io/github/npm/libnpmexec?branch=main)\n\nThe `npm exec` (`npx`) Programmatic API\n\n## Install\n\n`npm install libnpmexec`\n\n## Usage:\n\n```js\nconst libexec = require('libnpmexec')\nawait libexec({\n  args: ['yosay', 'Bom dia!'],\n  cache: '~/.npm/_cacache',\n  npxCache: '~/.npm/_npx',\n  yes: true,\n})\n```\n\n## API:\n\n### `libexec(opts)`\n\n- `opts`:\n  - `args`: List of pkgs to execute **Array\u003cString\u003e**, defaults to `[]`\n  - `call`: An alternative command to run when using `packages` option **String**, defaults to empty string.\n  - `cache`: The path location to where the npm cache folder is placed **String**\n  - `npxCache`: The path location to where the npx cache folder is placed **String**\n  - `color`: Output should use color? **Boolean**, defaults to `false`\n  - `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.\n  - `locationMsg`: Overrides \"at location\" message when entering interactive mode **String**\n  - `log`: Sets an optional logger **Object**, defaults to `proc-log` module usage.\n  - `globalBin`: Location to the global space bin folder, same as: `$(npm bin -g)` **String**, defaults to empty string.\n  - `output`: A function to print output to **Function**\n  - `packages`: A list of packages to be used (possibly fetch from the registry) **Array\u003cString\u003e**, defaults to `[]`\n  - `path`: Location to where to read local project info (`package.json`) **String**, defaults to `.`\n  - `runPath`: Location to where to execute the script **String**, defaults to `.`\n  - `scriptShell`: Default shell to be used **String**, defaults to `sh` on POSIX systems, `process.env.ComSpec` OR `cmd` on Windows\n  - `yes`: Should skip download confirmation prompt when fetching missing packages from the registry? **Boolean**\n  - `registry`, `cache`, and more options that are forwarded to [@npmcli/arborist](https://github.com/npm/arborist/) and [pacote](https://github.com/npm/pacote/#options) **Object**\n\n## LICENSE\n\n[ISC](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Flibnpmexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm%2Flibnpmexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Flibnpmexec/lists"}