https://github.com/eyolas/privatebin
Client Library to interact with privatebin (https://privatebin.net)
https://github.com/eyolas/privatebin
Last synced: 4 months ago
JSON representation
Client Library to interact with privatebin (https://privatebin.net)
- Host: GitHub
- URL: https://github.com/eyolas/privatebin
- Owner: eyolas
- License: mit
- Created: 2024-12-11T18:06:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-27T13:26:48.000Z (over 1 year ago)
- Last Synced: 2025-08-07T00:39:05.844Z (11 months ago)
- Language: TypeScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
# @eyolas/privatebin
Client Library to interact with privatebin (https://privatebin.net)
### Installation
Deno
```bash
deno add jsr:@eyolas/privatebin
```
pnpm
```bash
pnpm dlx jsr add @eyolas/privatebin
```
### Usage
```typescript
import { createKey, PrivatebinClient } from "@eyolas/privatebin";
const urlPrivatebin = "https://privatebin.net";
const privatebin = new PrivatebinClient(urlPrivatebin);
const key = createKey();
const msg = "Hello World!";
const opts = {
textformat: "plaintext",
expire: "1week",
burnafterreading: 1,
opendiscussion: 0,
output: "text",
compression: "zlib",
} satisfies PrivatebinOptions;
const paste = await privatebin.sendText(msg, key, opts);
console.log(privatebin.getUrl(paste, key));
console.log(await privatebin.getText(paste.id, key));
```