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

universal-clipboard-js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

universal-clipboard-js

Ready to be a universal clipboard library for all platforms

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

universal-clipboard-js

Ready to be a universal clipboard library for all platforms.

中文|English

How to use

very simple

const { readText, writeText, FORMAT_FILE_URL } = require('../index.js')
console.log(readText(), 'result')
console.log(readText(FORMAT_FILE_URL), 'file path result')

console.log(
  writeText(
    'file:///Users/ZhangXiaohua/Documents/LearningMaterials/C++FromEntryToGrave.pdf',
    FORMAT_FILE_URL
  ),
  'writeText result'
)

API

// clear your clipboard
export function clear(): void

// read or write buffer to clipboard
// The default value of format is FORMAT_PLAIN_TEXT
export function readBuffer(format?: string): Buffer
export function writeBuffer(data: Buffer, format?: string): boolean

// read or write text to clipboard
// The default value of format is FORMAT_PLAIN_TEXT
export function readText(format?: string): string
export function writeText(text: string, format?: string): boolean

// clipboard content fromat, text or file path
export const FORMAT_PLAIN_TEXT: string
export const FORMAT_FILE_URL: string

TODO

  • Window
  • Linux
  • ......

Support

  • MacOS

Keywords

FAQs

Package last updated on 25 Oct 2022

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