Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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