xsel

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i xsel

Weekly Downloads

766

Version

1.0.0

License

none

Unpacked Size

3.64 kB

Total Files

3

Last publish

Collaborators

  • jauntywunderkind