1.0.0 • Published 6 years ago
xsel v1.0.0
xsel
Simple wrapper for linux xsel.
- If you are not familiar with Linux Clipboard visit http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki/
Install
npm install xsel
Usage
var xsel = require('xsel')
await xsel.set('data to save')
console.log('data was copied to clipboard') // => data was copied to clipboard
await xsel.get(function(error, data)
console.log('clipboard data => ' + data) // => clipboard data => data to saveDocs
selection argument is a String and can be:"p": PRIMARY"s": SECONDARY"c": CLIPBOARD (default)
await xsel.set(data, [selection])Save data to the selection
await xsel.get([selection])Get data from the selection
await xsel.clear([selection])Clear the selection
await xsel.remove([selection])Request that the selection be cleared and that
the application owning it delete its contents
await xsel.keep(callback)Do not modify the selections, but make the PRIMARY
and SECONDARY selections persist even after the
programs they were selected in exit.
await xsel.exchange(callback)Exchange the PRIMARY and SECONDARY selections
1.0.0
6 years ago