Have ideas to improve npm?Join in the discussion! »

    mv
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/mv package

    2.1.1 • Public • Published

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

    Install

    npm i mv

    DownloadsWeekly Downloads

    1,358,020

    Version

    2.1.1

    License

    MIT

    Last publish

    Collaborators

    • avatar