1.3.0-1 • Published 3 years ago

universal-clipboard v1.3.0-1

Weekly downloads
16
License
BSD-3-Clause
Repository
-
Last release
3 years ago

getClipboard

npm npm

Gets the content on the system clipboard.

Install

$ npm install universal-getClipboard --save

or

$ npm install universal-api --save

Usage

import getClipboard from 'universal-getClipboard';

getClipboard({
  success (res){
    console.log(res.text);
  }
});

// promise
getClipboard().then(res => {
  console.log(res.text);
});

Methods

getClipboard()

Supported

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobject ✔️-
options.successFunction The callback function for a successful API call-
options.failFunction The callback function for a failed API call-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

Return

PropertyTypeDescription
resobject
res.textstringThe clipboard content

setClipboard

npm npm

Sets the content on the system clipboard.

Install

$ npm install universal-setClipboard --save

or

$ npm install universal-api --save

Usage

import setClipboard from 'universal-setClipboard';

setClipboard({
  text: 'text',
  success (res){
    console.log(res);
  }
});

// promise
setClipboard({
  text: 'text'
}).then(res => {
  console.log(res);
});

Methods

setClipboard()

Supported

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobject✔️-
options.textstringThe clipboard content✔️-
options.successFunction The callback function for a successful API call-
options.failFunction The callback function for a failed API call-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-
2.0.0-beta

3 years ago

1.2.0

4 years ago

1.3.0-0

4 years ago

1.3.0-1

4 years ago

1.0.1

4 years ago

1.0.0-beta.4

5 years ago

1.0.0-beta.3

5 years ago

1.0.0

5 years ago

1.0.0-beta.2

5 years ago

1.0.0-beta.1

5 years ago