### nypm API: ensureDependencyInstalled Function Source: https://github.com/unjs/nypm/blob/main/README.md Documentation for the `ensureDependencyInstalled` function, which verifies if a dependency is installed and installs it if it's missing. ```APIDOC ensureDependencyInstalled(name, options) ``` -------------------------------- ### Install nypm Package for API Usage Source: https://github.com/unjs/nypm/blob/main/README.md Instructions for installing the `nypm` package using various package managers (npx, npm, yarn, pnpm, bun, deno) to enable its API usage in your projects. ```sh # ✨ Auto-detect npx nypm install nypm ``` ```sh # npm npm install nypm ``` ```sh # yarn yarn add nypm ``` ```sh # pnpm pnpm install nypm ``` ```sh # bun bun install nypm ``` ```sh # deno deno install nypm ``` -------------------------------- ### Install Project Dependencies using nypm command Source: https://github.com/unjs/nypm/blob/main/README.md Demonstrates how to install project dependencies using the `npx nypm i` command, which automatically detects the project's package manager. ```sh npx nypm i ``` -------------------------------- ### nypm API: installDependencies Function Source: https://github.com/unjs/nypm/blob/main/README.md Documentation for the `installDependencies` function, which programmatically installs all project dependencies based on the detected package manager. ```APIDOC installDependencies(options) ``` -------------------------------- ### Add a Dependency using nypm command Source: https://github.com/unjs/nypm/blob/main/README.md Shows how to add a new dependency to the project using `npx nypm add `, simplifying dependency management across different package managers. ```sh npx nypm add defu ``` -------------------------------- ### nypm API: dedupeDependencies Function Source: https://github.com/unjs/nypm/blob/main/README.md Documentation for the `dedupeDependencies` function, which deduplicates project dependencies. For Bun and Deno, this involves removing the lockfile and reinstalling all dependencies. ```APIDOC dedupeDependencies(options) ``` -------------------------------- ### nypm API: runScript Function Source: https://github.com/unjs/nypm/blob/main/README.md Documentation for the `runScript` function, which executes a script defined in the project's `package.json` file. ```APIDOC runScript(name, options) ``` -------------------------------- ### Import nypm API Functions Source: https://github.com/unjs/nypm/blob/main/README.md Demonstrates how to import `nypm` API functions into a JavaScript project using both ESM import syntax and dynamic import for flexible integration. ```js // ESM import import { addDependency } from "nypm"; // or dynamic import const { addDependency } = await import("nypm"); ``` -------------------------------- ### Remove a Dependency using nypm command Source: https://github.com/unjs/nypm/blob/main/README.md Illustrates how to remove an existing dependency from the project using `npx nypm remove `, providing a unified interface for dependency removal. ```sh npx nypm remove defu ``` -------------------------------- ### nypm API: detectPackageManager Function Source: https://github.com/unjs/nypm/blob/main/README.md Documentation for the `detectPackageManager` function, which identifies the package manager used in a specified directory by checking `package.json` and known lock files. ```APIDOC detectPackageManager(cwd, options) ``` -------------------------------- ### nypm API: addDependency Function Source: https://github.com/unjs/nypm/blob/main/README.md Documentation for the `addDependency` function, which programmatically adds a dependency to the project. It takes the dependency name and an options object. ```APIDOC addDependency(name, options) ``` -------------------------------- ### nypm API: addDevDependency Function Source: https://github.com/unjs/nypm/blob/main/README.md Documentation for the `addDevDependency` function, used to programmatically add a development dependency to the project. It accepts the dependency name and options. ```APIDOC addDevDependency(name, options) ``` -------------------------------- ### nypm API: removeDependency Function Source: https://github.com/unjs/nypm/blob/main/README.md Documentation for the `removeDependency` function, used to programmatically remove a dependency from the project. ```APIDOC removeDependency(name, options) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.