1.0.0 • Published 4 years ago

xsel v1.0.0

Weekly downloads
42
License
-
Repository
github
Last release
4 years ago

xsel

Simple wrapper for linux xsel.

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 save

Docs

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