# @types/async-writer

> TypeScript definitions for async-writer

Latest version **1.4.34** (published 2023-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/async-writer
pnpm add @types/async-writer
yarn add @types/async-writer
bun add @types/async-writer
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.4.34 |
| Published | 2023-11-06 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/async-writer
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async-writer
- npm.io page: https://npm.io/package/@types/async-writer

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 1.4.34 (latest) — 2023-11-06
- 1.4.31 (ts3.6) — 2021-07-07
- 1.4.30 (ts2.0) — 2016-09-19
- 1.4.33 — 2023-10-17
- 1.4.32 — 2023-09-22
- 1.4.29 — 2016-07-14
- 1.4.28-alpha — 2016-07-08
- 1.4.27-alpha — 2016-07-03
- 1.4.26-alpha — 2016-07-02
- 1.4.25-alpha — 2016-07-01
- 1.4.24-alpha — 2016-07-01
- 1.4.23-alpha — 2016-05-25
- 1.4.22-alpha — 2016-05-20
- 1.4.17-alpha — 2016-05-19
- 1.4.16-alpha — 2016-05-17

## README

# Installation
> `npm install --save @types/async-writer`

# Summary
This package contains type definitions for async-writer (https://github.com/marko-js/async-writer).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async-writer.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async-writer/index.d.ts)
````ts
/// <reference types="node" />

import stream = require("stream");
import events = require("events");

declare namespace async_writer {
    interface EventFunction {
        (event: string, callback: Function): void;
    }

    class StringWriter {
        constructor(events: events.EventEmitter);
        end(): void;
        write(what: string): StringWriter;
        toString(): string;
    }

    class BufferedWriter {
        constructor(wrappedStream: stream.Stream);
        flush(): void;
        on(event: string, callback: Function): BufferedWriter;
        once(event: string, callback: Function): BufferedWriter;
        clear(): void;
        end(): void;
        write(what: string): BufferedWriter;
    }

    interface BeginAsyncOptions {
        last?: boolean | undefined;
        timeout?: number | undefined;
        name?: string | undefined;
    }

    class AsyncWriter {
        static enableAsyncStackTrace(): void;

        constructor(writer?: any, global?: { [s: string]: any }, async?: boolean, buffer?: boolean);
        isAsyncWriter: AsyncWriter;
        sync(): void;
        getAttributes(): { [s: string]: any };
        getAttribute(): any;
        write(str: string): AsyncWriter;
        getOutput(): string;
        captureString(func: Function, thisObj: Object): string;
        swapWriter(newWriter: StringWriter | BufferedWriter, func: Function, thisObj: Object): void;
        createNestedWriter(writer: StringWriter | BufferedWriter): AsyncWriter;
        beginAsync(options?: number | BeginAsyncOptions): AsyncWriter;
        handleBeginAsync(options: number | BeginAsyncOptions, parent: AsyncWriter): void;
        on(event: string, callback: Function): AsyncWriter;
        once(event: string, callback: Function): AsyncWriter;
        onLast(callback: Function): AsyncWriter;
        emit(arg: any): AsyncWriter;
        removeListener(): AsyncWriter;
        pipe(stream: stream.Stream): AsyncWriter;
        error(e: Error): void;
        end(data?: any): AsyncWriter;
        handleEnd(isAsync: boolean): void;
        _finish(): void;
        flush(): void;
    }

    interface AsyncWriterOptions {
        global?: { [s: string]: any } | undefined;
        buffer?: boolean | undefined;
    }

    function create(writer?: any, options?: AsyncWriterOptions): AsyncWriter;
    function enableAsyncStackTrace(): void;
}

export = async_writer;

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:04 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Yuce Tekol](http://yuce.me/).

---
_Source: https://npm.io/package/@types/async-writer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
