Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zcong1993/bcf
Simple backoff lib
https://github.com/zcong1993/bcf
Last synced: 1 day ago
JSON representation
Simple backoff lib
- Host: GitHub
- URL: https://github.com/zcong1993/bcf
- Owner: zcong1993
- License: mit
- Created: 2017-11-06T02:52:05.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-08T02:27:54.000Z (over 6 years ago)
- Last Synced: 2024-10-27T09:18:20.249Z (12 days ago)
- Language: JavaScript
- Size: 36.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bcf
> Simple backoff lib for js
[![NPM version](https://img.shields.io/npm/v/bcf.svg?style=flat)](https://npmjs.com/package/bcf) [![NPM downloads](https://img.shields.io/npm/dm/bcf.svg?style=flat)](https://npmjs.com/package/bcf) [![CircleCI](https://circleci.com/gh/zcong1993/bcf/tree/master.svg?style=shield)](https://circleci.com/gh/zcong1993/bcf/tree/master) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/zcong1993/donate)
## Install
```bash
$ yarn add bcf
# npm
$ npm i bcf
```## Usage
```js
const BCF = require('bcf')const bcf = new BCF({
min: 200,
max: 1500,
factor: 3,
jitter: false
})bcf.duration()
// 200
bcf.duration()
// 600
bcf.duration()
// 1500 max is 1500
bcf.reset()
// reset
bcf.duration()
// 200
bcf.duration()
// 600
bcf.duration()
// 1500 max is 1500
```## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## Author
**bcf** © [zcong1993](https://github.com/zcong1993), Released under the [MIT](./LICENSE) License.
Authored and maintained by zcong1993 with help from contributors ([list](https://github.com/zcong1993/bcf/contributors)).> [github.com/zcong1993](https://github.com/zcong1993) · GitHub [@zcong1993](https://github.com/zcong1993)