# vite-node-dev

> Run Node scripts with vite-node and reload them when they are changed.

Latest version **3.0.0** (published 2024-01-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install vite-node-dev
pnpm add vite-node-dev
yarn add vite-node-dev
bun add vite-node-dev
```

Provides the command `vite-node-dev`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2024-01-10 |
| First published | 2022-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 4 |
| Unpacked size | 23.5 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | yes |
| GitHub stars | 6 |
| Author | Hugo Brosnahan |
| Maintainers | hugo-t-b |
| Keywords | vite, cli, development, monitor, restart, reload |

## Links

- npm: https://www.npmjs.com/package/vite-node-dev
- Repository: https://github.com/hugo-t-b/vite-node-dev
- Homepage: https://github.com/hugo-t-b/vite-node-dev#readme
- Issues: https://github.com/hugo-t-b/vite-node-dev/issues
- npm.io page: https://npm.io/package/vite-node-dev

## Dependencies (4)

- [vite](https://npm.io/package/vite.md) ^5.0.11
- [colorette](https://npm.io/package/colorette.md) ^2.0.20
- [commander](https://npm.io/package/commander.md) ^11.1.0
- [vite-node](https://npm.io/package/vite-node.md) ^1.1.3

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2024-01-10
- 2.0.0 — 2022-12-12
- 1.1.0 — 2022-10-09
- 1.0.0 — 2022-08-07
- 0.3.1 — 2022-07-04
- 0.3.0 — 2022-07-04
- 0.2.1 — 2022-05-28
- 0.2.0 — 2022-05-08
- 0.1.0 — 2022-04-25
- 0.0.2 — 2022-04-23
- 0.0.1 — 2022-04-22

## README

# vite-node-dev

> Run Node scripts with [vite-node](https://www.npmjs.com/package/vite-node) and reload them when they are changed.

## Overview
> [!WARNING]  
> The functionality that vite-node-dev provides is now [natively supported by vite-node](https://github.com/vitest-dev/vitest/pull/890). As a result, vite-node-dev is no longer being maintained and you should instead use vite-node's `--watch` option:
> ```bash
> vite-node --watch <file>
> ```

By default, vite-node has lightning fast support for TypeScript, ESM, Vite plugins, and more! This makes it a great choice for running Node apps. vite-node-dev allows you to run scripts with vite-node while automatically reloading them on change.

## Installation

The recommended way to install vite-node-dev is as a dev-dependency of your project with npm (or yarn/pnpm):

```bash
npm install --save-dev vite-node-dev
```

It can also be installed globally:

```bash
npm install --global vite-node-dev
```

## Usage

### Running a Script

To run a script with vite-node-dev, type `vite-node-dev` followed by the name of the file. If it is installed locally, prefix the command with `npx`.

```bash
npx vite-node-dev [filename]
```

You might want to add a script for this command to your project's `package.json`. To run the following script, type `npm run dev`.

```jsonc
"scripts": {
  // ...
  "dev": "vite-node-dev index.js" // You can omit the npx prefix inside a script
}
```

### Manually Restarting a Running Script

To manually restart a running script without quitting vite-node-dev, type `rs` and hit `enter`.

### Running a Script Without Reloading

The `--run` or `-r` flag instructs vite-node-dev to run a script with vite-node without reloading it: 

```bash
npx vite-node-dev --run [filename]
```

This is effectively equivalent to plain vite-node, but removes the need to manually install another dependency and can easily be passed as an additional argument to npm scripts.

## License

MIT license: [https://github.com/hugo-t-b/vite-node-dev/blob/main/LICENSE.txt](https://github.com/hugo-t-b/vite-node-dev/blob/main/LICENSE.txt).

---
_Source: https://npm.io/package/vite-node-dev · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
