@mariozechner/clipboard
> **Fork of [@crosscopy/clipboard](https://github.com/CrossCopy/clipboard)** > > This fork updates to the latest `clipboard-rs` (0.3.1) and adds musl (Alpine Linux) support. > All credit goes to the original authors.
Last updated 2 months ago by badlogic .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mariozechner/clipboard 
SYNC missed versions from official npm registry.

@mariozechner/clipboard

Fork of @crosscopy/clipboard

This fork updates to the latest clipboard-rs (0.3.1) and adds musl (Alpine Linux) support. All credit goes to the original authors.

NPM Version CI

NPM Package: https://www.npmjs.com/package/@mariozechner/clipboard

GitHub: https://github.com/badlogic/clipboard

This is a clipboard API npm package that allows you to copy and paste data to and from the clipboard. There doesn't seem to be a good clipboard package for node.js (that supports data format beyond text), so I decided to make one. Data Format Supported

  • Text
  • Image
  • Rich Text Format
  • Files
  • HTML

Acknowledgements

  • ChurchTao/clipboard-rs is written in rust, which is used to provide the native clipboard support for this package across Linux, Windows and MacOS. This package is basically a wrapper around this rust package.
  • napi.rs was used to create the node.js addon for this package, so that API calls written in rust can be called from node.js.

API

Detailed API function declarations can be found in the index.d.ts.

Or you can refer to the source code in src/lib.rs.

Sample

import Clipboard from "@mariozechner/clipboard";

console.log(await Clipboard.getText());

console.log(await Clipboard.getHtml());

if (await Clipboard.hasImage()) {
  console.log(await Clipboard.getImageBase64());
} else {
  console.log("No Image");
}

Publish

Everything is done with GitHub Action.

Run npm version patch to bump the version. Then git push --follow-tags to push the changes and tags to GitHub. GitHub Action will automatically build and publish.

Current Tags

  • 0.3.2                                ...           latest (2 months ago)

2 Versions

  • 0.3.2                                ...           2 months ago
  • 0.3.0                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2013 - present © cnpmjs.org | Home |