Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@creately/clipboard

Package Overview
Dependencies
Maintainers
7
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@creately/clipboard

Clipboard Service which uses system clipboard as primary and local storage as fallback.

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by100%
Maintainers
7
Weekly downloads
 
Created
Source

@creately/clipboard

Clipboard service which uses system clipboard as primary and local storage as fallback.

Support: All browsers and Embedded( iframe ).

Install

$ npm install @creately/clipboard

Usage

import { Clipboard } from '@creately/clipboard';

new Clipboard().copy('your data');

console.log(await new Clipboard().paste());
//=> 'your data'

Usage with Angular

// Import it in module
import { Clipboard } from '@creately/clipboard';

// Add this in your module.
{ provide: Clipboard, useFactory: () => new Clipboard() },

// Add clipboard in constructor.
class MyClass {
  constructor( private clipboard: Clipboard ) {}
  // ...

  public doCopy( data ) {
    this.clipboard.copy( data );  
  }

  public async doPaste() {
    return await this.clipboard.paste();
  }
}

API

.copy(text)

Copy given text clipboard asynchronously. Returns a Promise.

text

Type: string

The text to write to the clipboard.

.paste()

Paste from the clipboard asynchronously. Returns a Promise.

FAQs

Package last updated on 29 Apr 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc