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: 29 days ago
JSON representation
macOS NSPasteboard API bindings for Deno JIT FFI.
- Host: GitHub
- URL: https://github.com/littledivy/pasteboard
- Owner: littledivy
- License: apache-2.0
- Created: 2023-11-10T05:39:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-06T06:51:07.000Z (over 1 year ago)
- Last Synced: 2025-03-31T14:21:22.818Z (2 months ago)
- Topics: clipboard, deno, ffi, obj-c, pasteboard
- Language: TypeScript
- Homepage: https://deno.land/x/pasteboard
- Size: 9.77 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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).