Manipulate Clipboard in Node.js via native API.

Overview

@napi-rs/clipboard

Manipulate Clipboard in Node.js via native API.

It's a Node.js binding for 1Password/aboard

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
Comments
  • chore(deps): update yarn to v3.3.1 - autoclosed

    chore(deps): update yarn to v3.3.1 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | yarn | 3.3.0 -> 3.3.1 | age | adoption | passing | confidence |


    Release Notes

    yarnpkg/berry

    v3.3.1

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): lock file maintenance

    chore(deps): lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 3am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update yarn to v3.3.0

    chore(deps): update yarn to v3.3.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | yarn | 3.2.4 -> 3.3.0 | age | adoption | passing | confidence |


    Release Notes

    yarnpkg/berry

    v3.3.0

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): lock file maintenance

    chore(deps): lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 3am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency ava to v5

    chore(deps): update dependency ava to v5

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | ava (source) | ^4.3.0 -> ^5.0.0 | age | adoption | passing | confidence |


    Release Notes

    avajs/ava

    v5.0.1

    Compare Source

    Despite the major version bump this is a relatively minor release. Node.js 12 is no longer supported. The type definitions are now distributed to be compatible with TypeScript 4.7 or newer.

    npm install --save-dev ava
    

    Breaking Changes

    Improvements

    New Contributors

    Full Changelog: https://github.com/avajs/ava/compare/v4.3.3...v5.0.1

    v5.0.0

    Compare Source

    Despite the major version bump this is a relatively minor release. Node.js 12 is no longer supported. The type definitions are now distributed to be compatible with TypeScript 4.7 or newer.

    It's available as a pre-release under the next tag for the next few weeks:

    npm install --save-dev ava@next
    

    Breaking Changes

    Improvements

    New Contributors

    Full Changelog: https://github.com/avajs/ava/compare/v4.3.3...v5.0.0


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update yarn to v3.2.4

    chore(deps): update yarn to v3.2.4

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | yarn | 3.2.3 -> 3.2.4 | age | adoption | passing | confidence |


    Release Notes

    yarnpkg/berry

    v3.2.4

    Compare Source

    Compatibility
    • The patched filesystem now supports fchown.
    • PnP now handles private import mappings.
    • Updates the PnP compatibility layer for TypeScript v4.8.4 and v4.9.1-beta.
    • PnP now reports loaded modules when in watch mode.

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ?? Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate arboard to v3

    fix(deps): update rust crate arboard to v3

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | arboard | dependencies | major | 2 -> 3 |


    Release Notes

    1Password/arboard

    v3.2.0

    Compare Source

    Changed
    • The Windows clipboard now behaves consistently with the other platform implementations again.
    • Significantly improve cross-platform documentation of Clipboard.
    • Remove lingering uses of the dbg! macro in the Wayland backend.

    v3.1.1

    Compare Source

    Added
    • Implemented the ability to set HTML on the clipboard
    Changed
    • Updated minimum clipboard-win version to 4.4.
    • Updated wl-clipboard-rs to the version 0.7.

    v3.1.0

    Compare Source

    Changed
    • Updated image to the version 0.24.
    • Lowered Wayland clipboard initialization log level.

    v3.0.0

    Compare Source

    Added
    • Support for clearing the clipboard.
    • Spport for excluding Windows clipboard data from cliboard history and OneDrive.
    • Support waiting for another process to read clipboard data before returning from a write call to a X11 and Wayland or clipboard
    Changed
    • Updated wl-clipboard-rs to the version 0.6.
    • Updated x11rb to the version 0.10.
    • Cleaned up spelling in documentation
    • (Breaking) Functions that used to accept String now take Into<Cow<'a>, str> instead. This avoids cloning the string more times then necessary on platforms that can.
    • (Breaking) Error is now marked as #[non_exhaustive].
    • (Breaking) Removed all platform specific modules and clipboard structures from the public API. If you were using these directly, the recommended replacement is using arboard::Clipboard and the new platform-specific extension traits instead.

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Lock file maintenance

    Lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 3am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ Warning: custom changes will be lost.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Yarn to v3.2.3

    Update Yarn to v3.2.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | yarn | 3.2.2 -> 3.2.3 | age | adoption | passing | confidence |


    Release Notes

    yarnpkg/berry

    v3.2.3

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • Cargo.toml (cargo)
    • .github/workflows/CI.yml (github-actions)
    • npm/darwin-arm64/package.json (npm)
    • npm/darwin-x64/package.json (npm)
    • npm/linux-arm-gnueabihf/package.json (npm)
    • npm/linux-arm64-gnu/package.json (npm)
    • npm/linux-arm64-musl/package.json (npm)
    • npm/linux-x64-gnu/package.json (npm)
    • npm/linux-x64-musl/package.json (npm)
    • npm/win32-arm64-msvc/package.json (npm)
    • npm/win32-ia32-msvc/package.json (npm)
    • npm/win32-x64-msvc/package.json (npm)
    • package.json (npm)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 1 Pull Request:

    Lock file maintenance
    • Schedule: ["before 3am on the first day of the month"]
    • Branch name: renovate/lock-file-maintenance
    • Merge into: main
    • Regenerate lock files to use latest dependency versions

    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): lock file maintenance

    chore(deps): lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 3am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    cargo
    Cargo.toml
    • arboard 3
    • napi 2
    • napi-derive 2
    • napi-build 2
    github-actions
    .github/workflows/CI.yml
    • actions/checkout v3
    • actions/setup-node v3
    • actions/cache v3
    • goto-bus-stop/setup-zig v2
    • actions/setup-node v3
    • addnab/docker-run-action v3
    • actions/upload-artifact v3
    • actions/checkout v3
    • actions/setup-node v3
    • actions/download-artifact v3
    • actions/checkout v3
    • actions/setup-node v3
    • actions/download-artifact v3
    • addnab/docker-run-action v3
    • actions/checkout v3
    • actions/setup-node v3
    • actions/download-artifact v3
    • addnab/docker-run-action v3
    • actions/checkout v3
    • actions/download-artifact v3
    • addnab/docker-run-action v3
    • actions/checkout v3
    • actions/download-artifact v3
    • addnab/docker-run-action v3
    • actions/checkout v3
    • actions/setup-node v3
    • actions/download-artifact v3
    npm
    npm/darwin-arm64/package.json
    • node >= 10
    npm/darwin-x64/package.json
    • node >= 10
    npm/linux-arm-gnueabihf/package.json
    • node >= 10
    npm/linux-arm64-gnu/package.json
    • node >= 10
    npm/linux-arm64-musl/package.json
    • node >= 10
    npm/linux-x64-gnu/package.json
    • node >= 10
    npm/linux-x64-musl/package.json
    • node >= 10
    npm/win32-arm64-msvc/package.json
    • node >= 10
    npm/win32-ia32-msvc/package.json
    • node >= 10
    npm/win32-x64-msvc/package.json
    • node >= 10
    package.json
    • @napi-rs/cli ^2.14.1
    • @napi-rs/image ^1.4.4
    • ava ^5.1.0
    • node >= 10
    • yarn 3.3.1

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Releases(v1.0.1)
Owner
LongYinan
TypeScript at day, Rustacean at night. Coding for fun.
LongYinan
Piccloud is a full-stack (Angular & Spring Boot) online image clipboard that lets you share images over the internet by generating a unique URL. Others can access the image via this URL.

Piccloud Piccloud is a full-stack application built with Angular & Spring Boot. It is an online image clipboard that lets you share images over the in

Olayinka Atobiloye 3 Dec 15, 2022
A Drag-and-Drop library for all JavaScript frameworks implementing an enhanced transformation mechanism to manipulate DOM elements

JavaScript Project to Manipulate DOM Elements DFlex A Drag-and-Drop library for all JavaScript frameworks implementing an enhanced transformation mech

DFlex 1.5k Jan 8, 2023
A simple to-do app for managing daily tasks built with Webpack, JavaScript, HTML, and CSS with the functionality to manipulate multiple completed tasks and store them to local storage.

TODO LIST APP In this project, I have built a simple HTML list of To Do tasks. The list is styled according to the listed specifications . This simple

Selma Belhadj 8 Jun 7, 2022
Ready to manipulate partitions file? Create a custom partition, apply custom security system, hide the partition and share your hidden data on the www

Paranoia ?? Ready to manipulate partitions file? Create a custom partition, apply custom security system, hide the partition and share your hidden dat

Alice Snow 3 Dec 29, 2022
Hash.js is a 0.5 KB script that lets you in a super simple way manipulate everything behind # in urls.

Hash.js - URL Hash Manipulation Hash.js is a 0.5 KB script that lets you in a super simple way manipulate everything behind # in urls. Tested in lates

Jonny Strömberg 152 Aug 1, 2022
Manipulate the AST to transform your code.

unplugin-ast Manipulate the AST to transform your code. Installation npm i unplugin-ast Vite // vite.config.ts import AST from 'unplugin-ast/vite' ex

三咲智子 32 Dec 3, 2022
A package to manipulate string.

A package to manipulate string. Instalation use this command to installation npm install best-string imports import BestString from 'best-string' //o

sajjad isvand 4 Nov 17, 2022
Use better-sqlite3 to give obsidian the ability to manipulate sqlite3 databases

OBSIDIAN-SQLITE3 Use better-sqlite3 to give obisidian the ability to manipulate sqlite3 databases. Intention Currently the linkage between obsidian an

cloud 12 Nov 28, 2022
A simple way to share files and clipboard within a local network.

Shortcut Simple way to share files and clipboard with devices within a local network. Usage Run the ./shortcut executable. A browser window will be op

Dhamith Hewamullage 17 Mar 13, 2022
Lightweight library to copy PNG and JPG images to clipboard

Copy Image Clipboard Created with ❤️ by Luan Eduardo da Costa | Follow me on Linkedin ?? About This library allows you to copy JPG and PNG images (onl

Luan Eduardo da Costa 34 Nov 29, 2022
Chrome Extension that extracts metroretro.io JSON to your clipboard as an HTML list

retro-clippy Chrome Extension that extracts metroretro.io JSON to your clipboard as an HTML list Installation Clone repo and run yarn to install depen

Sherman Hui 2 Apr 11, 2022
A Virtual Interactive Keyboard which replicates every key you press and a Text-Area in which everything is written and can be copied to the clipboard with a click of a button.

A Virtual Interactive Keyboard which replicates every key you press and a Text-Area in which everything is written and can be copied to the clipboard with a click of a button.

Devang Joshi 1 Mar 1, 2021
cross-platform Deno library for writing and reading clipboard.

deno-clippy This is cross-platform Deno library for writing and reading clipboard. You can read from/write image and text. This library uses Rust's ar

skanehira 34 Dec 3, 2022
Clipboard extention for jQuery

jQlipboard jQlipboard is a jQuery extension that makes accessing the clipboard much easier. This plugin also has features that make it usable across a

null 5 Aug 9, 2021
Monitor incoming SMS for SMS-codes, add them to clipboard

MacOs only. Monitors SMS for codes, adds them to the clipboard. Monitors Messages SQLite file ~/Library/Messages/chat.db for new messages, uses regexp

Ilya Kantor 3 Sep 23, 2022
Copy to clipboard jQuery plugin.

jQuery - Copy to clipboard Plugin jQuery Copy to clipboard plugin - copy any text to the user site's clipboard. Operates on the basis of creating hidd

Milan Kyncl 16 Aug 21, 2022
blog with angular made in sass and firebase auth with google, facebook and github also you can copy to clipboard

BlogAngular This project was generated with Angular CLI version 14.1.2. Development server Run ng serve for a dev server. Navigate to http://localhost

John Gualteros 1 Oct 2, 2022
Next-level academia! Repository for the Native Overleaf project, attempting to integrate Overleaf with native OS features for macOS, Linux and Windows.

Native Overleaf Overleaf is a fantastic webtool for writing and cooperating on LaTeX documents. However, would it not be even better if it were to beh

Floris-Jan Willemsen 40 Dec 18, 2022