Skip to content

lee-devopa/nativescript-clipboard

 
 

Repository files navigation

NativeScript Clipboard

NPM version Downloads Twitter Follow

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

Installation

Run the following command from the root of your project:

tns plugin add nativescript-clipboard

Usage

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");
  })

getText

  clipboard.getText().then(function(content) {
      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.

About

📋 NativeScript plugin to copy stuff to the device clipboard, and read from it again

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%