Code Monkey home page Code Monkey logo

stubborn-fs's Introduction

Stubborn FS

Stubborn versions of Node's fs functions that try really hard to do their job.

Install

npm install --save stubborn-fs

Usage

The following functions are currently provided, if you need others please open an issue.

  • attempt functions swallow some errors that may occur.
  • retry functions are executed in a loop until they succeed or the timeout is reached, in which case an error is thrown.
import fs from 'stubborn-fs';

// Attempt functions (async)

fs.attempt.chmod;
fs.attempt.chown;
fs.attempt.close;
fs.attempt.fsync;
fs.attempt.mkdir;
fs.attempt.realpath;
fs.attempt.stat;
fs.attempt.unlink;

// Attempt functions (sync)

fs.attempt.chmodSync;
fs.attempt.chownSync;
fs.attempt.closeSync;
fs.attempt.existsSync;
fs.attempt.fsyncSync;
fs.attempt.mkdirSync;
fs.attempt.realpathSync;
fs.attempt.statSync;
fs.attempt.unlinkSync;

// Retry functions (async)

fs.retry.close;
fs.retry.fsync;
fs.retry.open;
fs.retry.readFile;
fs.retry.rename;
fs.retry.stat;
fs.retry.write;
fs.retry.writeFile;

// Retry functions (sync)

fs.retry.closeSync;
fs.retry.fsyncSync;
fs.retry.openSync;
fs.retry.readFileSync;
fs.retry.renameSync;
fs.retry.statSync;
fs.retry.writeSync;
fs.retry.writeFileSync;

License

MIT © Fabio Spampinato

stubborn-fs's People

Contributors

fabiospampinato avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

stubborn-fs's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.