Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deptno/ora-p
๐งค Promise based currying ora function
https://github.com/deptno/ora-p
cli curried currying loading ora promise terminal
Last synced: 7 days ago
JSON representation
๐งค Promise based currying ora function
- Host: GitHub
- URL: https://github.com/deptno/ora-p
- Owner: deptno
- Created: 2018-08-10T17:34:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-10T17:34:36.000Z (over 6 years ago)
- Last Synced: 2024-10-18T06:26:22.435Z (29 days ago)
- Topics: cli, curried, currying, loading, ora, promise, terminal
- Language: TypeScript
- Homepage:
- Size: 87.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ora-p
> Promise based currying ora function
![ora-p](ora-p.gif)
## Install
```sh
npm install ora-p
```## Usage
```typescript
ora('text', promise)
```#### with currying
```typescript
import ora from 'ora-p'// promise delay helper
const delayO = time => new Promise(r => setTimeout(r, time))
const delayX = time => new Promise((_, r) => setTimeout(r, time))// currying
const load = ora('loading')
const search = ora('searching')async function main() {
await load(delayO(1000))
await search(delayO(1000))
await load(delayO(1000))
await search(delayX(1000))
}
main() // screenshot
```## License
MIT