Skip to content

nfp-projects/node-mv-lite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Info

A lighter version of mv without the support for directory moving between devices (directory moving within same device works as well as files between devices).

This means this project has no dependancy to rimraf or ncp making it a lot lighter and smaller.

Usage:

var mv = require('mv-lite');

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
  // tries fs.rename
});

Another example:

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

About

Like `fs.rename`, but works with files across devices. Think of the unix utility `mv`.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%