mv
fs.rename but works across devices. same as the unix utility 'mv'
Last updated 4 years ago by superjoe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mv 
SYNC missed versions from official npm registry.

Build Status

Usage:

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:

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:

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

Current Tags

  • 2.1.1                                ...           latest (4 years ago)

12 Versions

  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.3                                ...           5 years ago
  • 2.0.2                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           7 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 95
This Week 7,014
This Month 22,639
Last Day 1,425
Last Week 7,721
Last Month 28,914
Dependencies (3)
Dev Dependencies (1)
Dependents (433)

Copyright 2014 - 2016 © taobao.org |