Skip to content

Commit 9946a6d

Browse files
committed
fix: README
1 parent d41ef3e commit 9946a6d

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
# Template
1+
# UNIX Socket
22

33
[![Run Linter](https://github.com/DenoPlayground/Template/actions/workflows/lint.yml/badge.svg)](https://github.com/DenoPlayground/Template/actions/workflows/lint.yml)
44
[![Run Unit Tests](https://github.com/DenoPlayground/Template/actions/workflows/test.yml/badge.svg)](https://github.com/DenoPlayground/Template/actions/workflows/test.yml)
55

6-
This is a template for a Deno module.
6+
Use this library to open and connect to UNIX sockets, send requests and get responses similar to a fetch request. This
7+
library supports basic response chunk decoding.
78

8-
## File/Directory Structure
9+
## Example
910

10-
- `cli.ts` - File for functions which should be executed directly for the module.
11-
- `src/` - Directory for storing all source code.
12-
- `docs/` - Directory for storing all documentation files specific for the module.
11+
Connect to the `docker.sock` UNIX socket, send a request to `/containers/json` and log the response.
12+
13+
```ts
14+
import { Socket } from '@typescriptplayground/socket';
15+
16+
const socket = new Socket('/var/run/docker.sock');
17+
18+
await socket.request('/containers/json')
19+
.then((res) => res.json())
20+
.then((json) => console.log(json));
21+
```

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@typescriptplayground/socket",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"license": "./LICENSE",
55
"exports": {
66
".": "./src/index.ts"

0 commit comments

Comments
 (0)