https://github.com/saehun/save-clipboard-image
https://github.com/saehun/save-clipboard-image
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/saehun/save-clipboard-image
- Owner: saehun
- License: mit
- Created: 2021-01-09T14:39:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T18:00:21.000Z (over 2 years ago)
- Last Synced: 2025-04-01T21:29:18.627Z (2 months ago)
- Language: TypeScript
- Size: 988 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# save-clipboard-image
Save clipboard image to file. works in Mac OSX NodeJS.## Install
### CLI
```
$ npm install -g save-clipboard-image
```
### API
```
$ npm install save-clipboard-image
```## Usage
### CLI
```
$ pbimage [filename]
```
### API
```ts
const { saveClipboardImage } = require('save-clipboard-image');(async () => {
const imagePath = await saveClipboardImage('./path/to/folder', 'image-name');console.log(image saved in', imagePath);
// '/Users/.../path/to/folder/image-name.png'
})();
```## `saveClipboardImage(folder[, filename])`
- `folder` a path to folder. default: `process.cwd()`
- `filename` a name of the image file. default: `Screen Shot ${Number(new Date())}`returns full path of the image file.