https://github.com/milly/deno-namedpipe
Windows Named Pipes server and client module for Deno.
https://github.com/milly/deno-namedpipe
deno named-pipes typescript windows
Last synced: 2 months ago
JSON representation
Windows Named Pipes server and client module for Deno.
- Host: GitHub
- URL: https://github.com/milly/deno-namedpipe
- Owner: Milly
- License: mit
- Created: 2024-05-14T23:20:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-13T15:47:32.000Z (about 1 year ago)
- Last Synced: 2025-07-19T09:27:57.437Z (3 months ago)
- Topics: deno, named-pipes, typescript, windows
- Language: TypeScript
- Homepage: https://jsr.io/@milly/namedpipe
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @milly/namedpipe
[](LICENSE)
[](https://jsr.io/@milly/namedpipe)
[](https://github.com/Milly/deno-namedpipe/actions/workflows/test.yml)
[](https://codecov.io/gh/Milly/deno-namedpipe)Windows Named Pipes server and client module for Deno.
Requires `allow-ffi`, `unstable-ffi`
[permission](https://docs.deno.com/runtime/manual/basics/permissions).# Requirements
[Deno](https://deno.com) v1.42 or later.
# Example
## Server
Can be used in the same way as [`Deno.listen`](https://deno.land/api?s=Deno.listen).
```typescript
import { listen } from "@milly/namedpipe";
import { TextLineStream } from "@std/streams/text-line-stream";const listener = listen({ path: "\\\\.\\pipe\\your-own-name" });
for await (const conn of listener) {
console.log("--- new conn ---");
conn.readable
.pipeThrough(new TextDecoderStream())
.pipeThrough(new TextLineStream())
.pipeTo(
new WritableStream({
write: (line) => console.log(line),
}),
);
}
```## Client
Can be used in the same way as [`Deno.connect`](https://deno.land/api?s=Deno.connect).
```typescript
import { connect } from "@milly/namedpipe";const conn = await connect({ path: "\\\\.\\pipe\\your-own-name" });
await ReadableStream
.from(["Hello\n", "World\n"])
.pipeThrough(new TextEncoderStream())
.pipeTo(conn.writable);
```# License
This library is licensed under the MIT License. See the [LICENSE](./LICENSE)
file for details.