Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/littledivy/pasteboard
- Owner: littledivy
- License: apache-2.0
- Created: 2023-11-10T05:39:40.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-06T06:51:07.000Z (11 months ago)
- Last Synced: 2024-10-10T18:13:20.497Z (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).