Skip to content

rawiroaisen/node-xsel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Nodejs Xsel

Simple wrapper for linux xsel.

Install

npm install xsel

Usage

var xsel = require('xsel')

xsel.set('data to save', function(error){
	console.log('data was copied to clipboard')

	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)

xsel.set(data, [selection], callback)

Save data to the selection

xsel.get([selection], callback)

Get data from the selection

xsel.clear([selection], callback)

Clear the selection

xsel.remove([selection], callback)

Request that the selection be cleared and that
the application owning it delete its contents

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.

xsel.exchange(callback)

Exchange the PRIMARY and SECONDARY selections

About

Nodejs wrapper for linux xsel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages