Giter VIP home page Giter VIP logo

outwork's Introduction

Outwork

Fault tolerance tools for TypeScript

out·work

/ˈoutˌwərk/

a section of a fortification or system of defense which is in front of the main part.

Example Usage

As a Decorator

class SomeClass {
  @retry({
    maxAttempts: 3,
    backOff: 100,
    backOffPolicy: BackOffPolicy.CONSTANT,
    shouldRetry: (e: Error) => {
      return e.message === 'Error: 429'
    },
  })
  async someFnWithConstantRateRetries(): Promise<any> {
    throw new Error('Error: 404')
  }

  @retry({
    maxAttempts: 3,
    backOffPolicy: BackOffPolicy.EXPONENTIAL,
    maxDelay: 1000,
    minDelay: 100,
    jitter: true,
  })
  async someFnWithExponentialBackOffRetries(): Promise<any> {
    return new Promise((_, reject) => {
      reject(new Error('Broke'))
    })
  }
}

As a HoF:

const myAsyncFunc = async (num: number, str: string): Promise<void> => {...}

const myAsyncFuncWithRetries =
  withRetry(myAsyncFunc, {
    maxAttempts: 3,
    backOffPolicy: BackOffPolicy.EXPONENTIAL,
    maxDelay: 1000,
    minDelay: 100,
    jitter: true
  })

Tools:

Available Scripts

  • build - compile TS
  • build:watch - interactive watch mode to automatically transpile source files
  • checkcommit - validate commit message
  • clean - remove coverage data, Jest cache and transpiled files,
  • clean-deps - remove node_modules
  • clean-generated - remove coverage and build directories and files
  • clean-logs - remove log files
  • commit - start commit
  • format - format files
  • lint - lint source files and tests,
  • nuke - clean everything
  • sort-pj - sort package.json
  • test - run tests,
  • test:watch - interactive watch mode to automatically re-run tests

outwork's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar jimador avatar jimador-sf avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

outwork's Issues

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

Automerging is not enabled for this account. You can enable it from the [account settings](https://app.dependabot.com/accounts/jimador/settings) screen in your Dependabot dashboard.

Please update the config file to conform with Dependabot's specification using our docs and online validator.

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

Automerging is not enabled for this account. You can enable it from the [account settings](https://app.dependabot.com/accounts/jimador/settings) screen in your Dependabot dashboard.

Please update the config file to conform with Dependabot's specification using our docs and online validator.

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

Automerging is not enabled for this account. You can enable it from the [account settings](https://app.dependabot.com/accounts/jimador/settings) screen in your Dependabot dashboard.

Please update the config file to conform with Dependabot's specification using our docs and online validator.

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.