Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

enfspatch-promise

1.0.3 • Public • Published

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.

Install

npm i enfspatch-promise

DownloadsWeekly Downloads

2

Version

1.0.3

License

CC-BY-4.0

Last publish

Collaborators

  • avatar