Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/littledivy/pasteboard

macOS NSPasteboard API bindings for Deno JIT FFI.
https://github.com/littledivy/pasteboard

clipboard deno ffi obj-c pasteboard

Last synced: 2 months ago
JSON representation

macOS NSPasteboard API bindings for Deno JIT FFI.

Awesome Lists containing this project

README

        

## pasteboard

macOS NSPasteboard API bindings for Deno JIT FFI.

### Usage

```typescript
import { OSXPasteboard } from "jsr:@divy/pasteboard";

const board = new OSXPasteboard();

board.clearContents(); // Clears the pasteboard contents.

board.writeText("Hello World!"); // Write UTF-8 encoded text to the pasteboard.

const text = board.readText();
```

```
deno run --allow-ffi --unstable-ffi example.ts
```

### Design

Depends on the `AppKit.framework` and Objective-C runtime.

Loads `/usr/lib/libobjc.A.dylib` and
`/System/Library/Frameworks/AppKit.framework/AppKit` at startup.

### License

See [LICENSE](./LICENSE).