> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# flowAsync

Creates an async pipeline that awaits each step before passing the result
to the next function. Like `flow` from es-toolkit but async-aware.

Each function can return a value or a Promise — `flowAsync` always returns
a Promise that resolves to the final step's awaited result.

```typescript
const getUsername = flowAsync(
  (id: string) => fetchUser(id),  // Promise<User>
  (user) => user.name,            // string
  (name) => name.toUpperCase(),
)
await getUsername('123') // 'ALICE'
```

## Usage

### `flowAsync(...functions)`

Creates an async pipeline that awaits each step before passing the result
to the next function. Like `flow` from es-toolkit but async-aware.

Each function can return a value or a Promise — `flowAsync` always returns
a Promise that resolves to the final step's awaited result.

```typescript
import { flowAsync } from 'massaman'
// or:  import { flowAsync } from 'massaman/function'

const getUsername = flowAsync(
  (id: string) => fetchUser(id),  // Promise<User>
  (user) => user.name,            // string
  (name) => name.toUpperCase(),
)
await getUsername('123') // 'ALICE'
```

#### Parameters


first(...args: A) => R1 | Promise<R1>required

the first pipeline function. It receives every argument passed to the composed function.


functionsArray<(value) => result | Promise<result>>required

the remaining pipeline functions. Each receives the awaited result of the previous function.

#### Returns

a composed function that always resolves to the awaited result of the final pipeline step.

```typescript
(...args: A) => Promise<Awaited<R>>
```
