https://github.com/alex8088/clipboard-files
A cross-platform Node.js native addon for reading or writing file paths to the clipboard. Supports Windows, MacOS and Linux.
https://github.com/alex8088/clipboard-files
clipboard electron nodejs
Last synced: 9 months ago
JSON representation
A cross-platform Node.js native addon for reading or writing file paths to the clipboard. Supports Windows, MacOS and Linux.
- Host: GitHub
- URL: https://github.com/alex8088/clipboard-files
- Owner: alex8088
- License: mit
- Created: 2019-04-23T05:32:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-10-04T06:14:26.000Z (9 months ago)
- Last Synced: 2025-10-04T08:25:03.974Z (9 months ago)
- Topics: clipboard, electron, nodejs
- Language: C++
- Homepage:
- Size: 771 KB
- Stars: 58
- Watchers: 3
- Forks: 25
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clipboard-files
A cross-platform Node.js native addon for reading or writing file paths to the clipboard. Supports Windows, MacOS and Linux.
## Install
```bash
npm i clipboard-files
```
## Usage
```js
const clipboard = require("clipboard-files");
// Read file paths from clipboard
const files = clipboard.readFiles();
console.log("Files in clipboard:", files);
// Write file paths to clipboard
clipboard.writeFiles(["/path/to/file1.txt", "/path/to/file2.txt"]);
```
## API
### readFiles()
Returns an array of strings containing file paths from the clipboard.
### writeFiles(files: string[])
Writes an array of file paths to the clipboard.
- `files`: Array of strings, each representing a file path
## Platform Support
- Windows
- macOS
- Linux (X11)
- Requires X11 development libraries
- Install on Ubuntu/Debian: `sudo apt-get install libx11-dev`
- Install on Fedora: `sudo dnf install libX11-devel`
## License
MIT