# bare-stdio

> Standard input/output streams for Bare

Latest version **1.0.3** (published 2026-07-08) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install bare-stdio
pnpm add bare-stdio
yarn add bare-stdio
bun add bare-stdio
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2026-07-08 |
| First published | 2026-04-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 460.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Holepunch |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/bare-stdio
- Repository: https://github.com/holepunchto/bare-stdio
- Homepage: https://github.com/holepunchto/bare-stdio#readme
- Issues: https://github.com/holepunchto/bare-stdio/issues
- npm.io page: https://npm.io/package/bare-stdio

## Dependencies (3)

- [bare-fs](https://npm.io/package/bare-fs.md) ^4.5.2
- [bare-tty](https://npm.io/package/bare-tty.md) ^5.0.3
- [bare-pipe](https://npm.io/package/bare-pipe.md) ^4.1.5

## Recent versions

- 1.0.3 (latest) — 2026-07-08
- 1.0.2 — 2026-04-02
- 1.0.1 — 2026-04-01
- 1.0.0 — 2026-04-01

## README

# bare-stdio

Standard input/output streams for Bare.

```
npm i bare-stdio
```

## Usage

```js
const stdio = require('bare-stdio')

// Write to stdout
stdio.out.write('Hello, World!\n')

// Write to stderr
stdio.err.write('An error occurred\n')

// Read from stdin
stdio.in.on('data', (data) => {
  console.log('Received:', data.toString())
})
```

## API

#### `stdio.in`

A readable stream for standard input (`fd 0`). Returns a `bare-tty` `ReadStream` if stdin is a terminal, a `bare-pipe` `Pipe` if it's a pipe, otherwise a `bare-fs` `ReadStream`.

#### `stdio.out`

A writable stream for standard output (`fd 1`). Returns a `bare-tty` `WriteStream` if stdout is a terminal, a `bare-pipe` `Pipe` if it's a pipe, otherwise a `bare-fs` `WriteStream`.

#### `stdio.err`

A writable stream for standard error (`fd 2`). Returns a `bare-tty` `WriteStream` if stderr is a terminal, a `bare-pipe` `Pipe` if it's a pipe, otherwise a `bare-fs` `WriteStream`.

## License

Apache-2.0

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