https://github.com/maxlath/copy2cb
A small module for CLI tools to write to both process.stdout and the clipboard.
https://github.com/maxlath/copy2cb
Last synced: about 2 months ago
JSON representation
A small module for CLI tools to write to both process.stdout and the clipboard.
- Host: GitHub
- URL: https://github.com/maxlath/copy2cb
- Owner: maxlath
- Created: 2016-05-29T09:44:50.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2023-11-30T14:49:13.000Z (over 2 years ago)
- Last Synced: 2025-08-27T02:21:05.366Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# copy2cb
A small module for CLI tools to write to both `process.stdout` and the clipboard.
This is mostly just a wrapper of the awesome [copy-paste](http://npmjs.com/package/copy-paste) module.
## Install
```sh
npm install --save copy2cb
```
## How-to
```javascript
var copy2cb = require('copy2cb')
var text = 'some string you want your command to write to stdout and also copy to your clipboard'
copy2cb(text, function() { process.exit(0) })
```
## Live examples
* in [wikidata-cli](https://github.com/maxlath/wikidata-cli/blob/master/bin/lib/copy.js)
* in [text-transform-cli](https://github.com/maxlath/text-transform-cli/blob/master/lib/copy.js)