# How to Use Executables from a Package Installed Locally in node_modules?

When you install a package locally using npm or yarn, the package's executables (if any) are typically added to the `node_modules/.bin` directory. You can use these executables directly from the command line or from npm scripts.

Here's how you can use executables from a locally installed package:

## From the Command Line

Assuming the package provides an executable named `example`:

```bash
# Run the locally installed executable
./node_modules/.bin/example
```

This directly executes the executable from the `node_modules/.bin` directory.

## From npm Scripts

In your `package.json` file, you can create npm scripts that use executables from locally installed packages. For example:

```json
{
  "scripts": {
    "run-example": "example"
  }
}
```

Now, you can run this script with:

```bash
npm run run-example
```

This will run the locally installed `example` executable.

## Using npx

You can also use `npx` to run executables from locally installed packages without referencing the `./node_modules/.bin` path directly:

```bash
npx example
```

This command looks for executables in the `node_modules/.bin` directory and automatically executes them.

Choose the method that best fits your use case, and make sure to replace `example` with the actual name of the executable you want to run.