rektide / node-xsel

Nodejs wrapper for linux xsel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:JavaScript 100.0%