Socket
Socket
Sign inDemoInstall

@napi-rs/clipboard

Package Overview
Dependencies
10
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @napi-rs/clipboard

> 🚀 Help me to become a full-time open-source developer by [sponsoring me on Github](https://github.com/sponsors/Brooooooklyn)


Version published
Weekly downloads
595
increased by25.53%
Maintainers
2
Install size
3.61 MB
Created
Weekly downloads
 

Readme

Source

@napi-rs/clipboard

🚀 Help me to become a full-time open-source developer by sponsoring me on Github

Manipulate Clipboard in Node.js via native API.

It's a Node.js binding for 1Password/aboard with additions from rgwood/clipboard-anywhere

install size Downloads

API

Text

import { Clipboard } from '@napi-rs/clipboard'

const clipboard = new Clipboard()

clipboard.setText('😅')
clipboard.getText() // '😅'

Image

import { join } from 'path'
import { fileURLToPath } from 'url'

import { Clipboard } from '@napi-rs/clipboard'
import { Transformer } from '@napi-rs/image'

const image = new Transformer(
  readFileSync(join(fileURLToPath(import.meta.url), '..', 'test.png'))
)
const { width, height } = await image.metadata()
const rawPixels = await image.rawPixels()
// Only accept raw RGBA pixels
clipboard.setImage(width, height, image)

// You can paste image now

FAQs

Last updated on 12 Feb 2024

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