enfspatch-promise

Patches for node fs module with promises


Keywords
appendFile, chown, fchown, lchown, chownSync, fchownSync, lchownSync, chmod, fchmod, lchmod, chmodSync, fchmodSync, lchmodSync, lutimes, lutimesSync, create, close, closeSync, directory, fs, file, file system, open, recursive, read, readdir, readFile, ReadStream, readSync, rename, write, WriteStream, writeFile
License
CC-BY-4.0
Install
npm install enfspatch-promise@1.0.3

Documentation

Build Status AppVeyour status Codacy Badge Donate

NPM

enfspatch-promise

Additional methods and patches for node fs module

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

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

Description

This module is just a wrapper for enfspath to enable the use of promises.

Usage

enfspatch-promise is a drop-in replacement for native fs module, you just need to include it instead of the native module.

Use this

    const enfs = require("enfspatch-promise");

All async methods finish with 'P', example: open => openP

    enfs.openP("/path","flags").then(function(fd){
        console.log(fd);
    });

instead of

    const fs = require("fs"); //You don't need to do this anymore

and all the methods from native fs module are available fir use with promises

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.

License

Creative Commons Attribution 4.0 International License

Copyright (c) 2017 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.