# trier.js **Repository Path**: mirrors_un33k/trier.js ## Basic Information - **Project Name**: trier.js - **Description**: Conditional and repeated function invocation for node and browser. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2026-11-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # trier.js [![Build status][ci-image]][ci-status] Because everyone loves a trier! Conditional and repeated function invocation for node and browser. ## Say what? Sometimes, you want to defer calling a function until a certain pre-requisite condition is met. Other times, you want to call a function repeatedly until some post-requisite condition is satisfied. Occasionally, you might even want to do both for the same function. To save you writing explicit conditions and loops on each of those occasions, trier.js implements a predicate-based approach that hides the cruft behind a simple, functional interface. Additionally, it allows you to easily specify retry intervals and limits, so that your code doesn't hog the CPU. It also supports exponential incrementation of retry intervals, which can be useful when handling indefinite error states such as network failure. ## How can I install it? You can install trier.js with one of the package managers: [NPM]; [Jam]; [Bower]; or [Component]. The package name for the first three is `trier` and for Component it's `philbooth/trier.js`: ``` npm install trier jam install trier bower install trier component install philbooth/trier.js ``` Alternatively, you can just clone the git repository from GitHub: ``` git clone git@github.com:philbooth/trier.js.git ``` ## How do I use it in my code? If you are running in [Node.js][node], [Browserify] or another CommonJS-style environment, you can `require` trier.js like so: ```javascript var trier = require('trier'); ``` It also the supports the AMD-style format preferred by [Require.js][require]: ```javascript require.config({ paths: { trier: 'trier.js/src/trier' } }); require([ 'trier' ], function (trier) { }); ``` If you are including trier.js with an HTML `