Socket
Socket
Sign inDemoInstall

nativescript-clipboard

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nativescript-clipboard

A clipboard plugin for use in NativeScript apps. You can copy and paste text from and to the clipboard.


Version published
Weekly downloads
936
increased by1.74%
Maintainers
1
Install size
10.1 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 15 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc