Socket
Book a DemoInstallSign in
Socket

enfscopy-promise

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enfscopy-promise

Copy files, directories and links in node cp -R with promises

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Build Status AppVeyor status Codacy Badge Donate

NPM

enfscopy-promise

Module that add copy functionality to node fs module with promises

enfs stands for [E]asy [N]ode [fs]

This module is intended to work as a sub-module of enfs-promise

Description

This module will add a method that allows the copy of multiple files and folder in the file system, similar to cp -R

  • This module will add following methods to node fs module:
    • copyP

Usage

enfscopy-promise

    const enfscopy = require("enfscopy-promise");

Errors

All the methods follows the node culture.

  • Async: Every async method returns an Error in the first callback parameter
  • Sync: Every sync method throws an Error.

Additional Methods

copyP

  • copyP(srcPath, dstPath, [options], callback)

Asynchronously copy items in the file system

[options]:

  • fs (Object): an alternative fs module to use (default will be enfspatch)
  • limit (Integer): the limit number of files being copied at a moment (Default: fs module limit or 512)
  • overwrite (Boolean): if true will overwrite destination files if they exist before copy (Default: false)
  • preserveTimestamps (Boolean): if true will preserve the timestamps of copied items (Default: false)
  • stopOnError (Boolean): if true will stop copy execution at first error (Default: false)
  • dereference (Boolean): if true will dereference symlinks copying the items to where it points (default: false)
  • errors (Array or Stream): If array or stream, the errors that occur will be logged and returned
    enfscopy.copyP("/path/to/src/folder", "/path/to/destination").then(function(statistics){
        console.log("Copied %d items with a total size of %d",statistics.items,statistics.size);
    }).catch(function(err){
        throw err;
    });

License

Creative Commons Attribution 4.0 International License

Copyright (c) 2016 Joao Parreira joaofrparreira@gmail.com GitHub

This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit CC-BY-4.0.

Keywords

copy

FAQs

Package last updated on 04 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.