mv-lite

1.0.0 • Public • Published

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'.
});

Package Sidebar

Install

npm i mv-lite

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

9 kB

Total Files

10

Last publish

Collaborators

  • thething