# mv

> fs.rename but works across devices. same as the unix utility 'mv'

Latest version **2.1.1** (published 2015-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install mv
pnpm add mv
yarn add mv
bun add mv
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2015-06-22 |
| First published | 2012-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/mv) |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 156 |
| Author | Andrew Kelley |
| Maintainers | superjoe |
| Keywords | mv, move, rename, device, recursive, folder |

## Links

- npm: https://www.npmjs.com/package/mv
- Repository: https://github.com/andrewrk/node-mv
- Issues: https://github.com/andrewrk/node-mv/issues
- npm.io page: https://npm.io/package/mv

## Dependencies (3)

- [ncp](https://npm.io/package/ncp.md) ~2.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ~0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ~2.4.0

## Recent versions

- 2.1.1 (latest) — 2015-06-22
- 2.1.0 — 2015-06-19
- 2.0.3 — 2014-07-26
- 2.0.2 — 2014-07-26
- 2.0.1 — 2014-06-30
- 2.0.0 — 2014-02-26
- 1.0.0 — 2013-09-08
- 0.0.5 — 2013-03-12
- 0.0.4 — 2012-12-12
- 0.0.3 — 2012-10-12
- 0.0.2 — 2012-10-12
- 0.0.1 — 2012-10-12

## README

[![Build Status](https://secure.travis-ci.org/andrewrk/node-mv.png)](http://travis-ci.org/andrewrk/node-mv)

Usage:
------

```js
var mv = require('mv');

mv('source/file', 'dest/file', function(err) {
  // done. it tried fs.rename first, and then falls back to
  // piping the source file to the dest file and then unlinking
  // the source file.
});
```

Another example:

```js
mv('source/dir', 'dest/a/b/c/dir', {mkdirp: true}, function(err) {
  // done. it first created all the necessary directories, and then
  // tried fs.rename, then falls back to using ncp to copy the dir
  // to dest and then rimraf to remove the source dir
});
```

Another example:

```js
mv('source/file', 'dest/file', {clobber: false}, function(err) {
  // done. If 'dest/file' exists, an error is returned
  // with err.code === 'EEXIST'.
});
```

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