@book-junction/clipboard

1.1.2 • Public • Published

Book Junction Clipboard

Author

Gaurav Sahitya

About:

This is a npm package that lets user to copy things onto their system's clipboard. This package works on all type of operating system like Windows, Ubuntu and Mac.

Package Requirements

  • Powershell
  • NodeJs
  • VS Code

Note: You can use any code editor of your choice.

Installation Steps

Note: If you are using Windows 10 or higher, you don't need to install PowerShell separately on your system, as it is already included in the operating system.

sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
source /etc/os-release
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell
pwsh

These installation steps are for ubuntu only.

Usage

const Clipboards=require("@book-junction/clipboards/build");

//Instantiate the class.

const object = new Clipboards.default();

(async () => await object.copy("text to copy")); // Your text is now copied to your clipboard, press Ctrl+V to test.

Note: Copy method can throw errors, so please handle them gracefully.

Where it can be used?

This package has numerous use cases, but one practical example is its application in writing Node.js commit message generator scripts. With it, you can automatically paste the generated commit message onto the system's clipboard.

Package Sidebar

Install

npm i @book-junction/clipboard

Weekly Downloads

20

Version

1.1.2

License

ISC

Unpacked Size

22.3 kB

Total Files

13

Last publish

Collaborators

  • sahityagaurav42