https://github.com/joseluisq/seqr
A small ES6 package for execute functions sequentially.
https://github.com/joseluisq/seqr
node-module sequential umd
Last synced: 2 months ago
JSON representation
A small ES6 package for execute functions sequentially.
- Host: GitHub
- URL: https://github.com/joseluisq/seqr
- Owner: joseluisq
- License: mit
- Created: 2016-07-13T05:56:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-19T18:53:19.000Z (over 8 years ago)
- Last Synced: 2026-01-12T20:26:11.849Z (2 months ago)
- Topics: node-module, sequential, umd
- Language: JavaScript
- Size: 85.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Seqr [](https://travis-ci.org/joseluisq/seqr) [](https://coveralls.io/github/joseluisq/seqr?branch=master) [](http://standardjs.com/)
> A small [ES6](https://babeljs.io/docs/learn-es2015/) package for execute functions sequentially.
## Install
[Yarn](https://github.com/yarnpkg/)
```sh
yarn add seqr --dev
```
[NPM](https://www.npmjs.com/)
```sh
npm install seqr --save-dev
```
[UMD](https://github.com/umdjs/umd/) file is also available on [unpkg](https://unpkg.com):
```html
```
You can use the library via `window.seqr`.
## Usage
```js
const seqr = require('seqr')()
const time = () => new Date().getTime()
seqr
.then(done => {
setTimeout(() => {
console.log('Seq 1:', time())
done()
}, 1000)
})
.then(done => {
setTimeout(() => {
console.log('Seq 2:', time())
done()
}, 2000)
})
seqr.then(done => {
console.log('Seq 3:', time())
done()
})
// Seq 1: 1468388509127
// Seq 2: 1468388511132
// Seq 3: 1468388511133
```
## Contributions
[Pull requests](https://github.com/joseluisq/seqr/pulls) and [issues](https://github.com/joseluisq/seqr/issues) are welcome.
## License
MIT license
© 2017 [José Luis Quintana](http://git.io/joseluisq)