Socket
Book a DemoInstallSign in
Socket

@napi-rs/clipboard

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

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)

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
2
Created
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

Package last updated on 05 Aug 2025

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