2.1.1 • Published 3 years ago

nativescript-clipboard v2.1.1

Weekly downloads
755
License
MIT
Repository
github
Last release
3 years ago

NativeScript Clipboard

Build Status NPM version Downloads TotalDownloads Twitter Follow

A NativeScript plugin to copy and paste data from and to the device clipboard.

💡 Plugin version 2.0.0+ is compatible with NativeScript 7+. If you need to target older NativeScript versions, please stick to plugin version 1.2.0.

Installation

Run the following command from the root of your project:

tns plugin add nativescript-clipboard

Usage

TIP: Check out the demo app for TypeScript examples.

To use this plugin you must first require() it:

var clipboard = require("nativescript-clipboard");

setText

  clipboard.setText("Something relevant to put on the clipboard.").then(function() {
      console.log("OK, copied to the clipboard");
  })

setTextSync

This is the synchronous version of setText, available since plugin version 1.2.0.

  clipboard.setTextSync("Something relevant to put on the clipboard.");

getText

  clipboard.getText().then(function(content) {
      console.log("Read from clipboard: " + content);
  })

getTextSync

This is the synchronous version of getText, available since plugin version 1.2.0.

  var content = clipboard.getText();
  console.log("Read from clipboard: " + content);

Future work

Implement support for storing data (image, etc) on the clipboard. Open an issue or PR in case you like to have that.

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

4 years ago

1.2.0

5 years ago

1.1.8

5 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago