universal-clipboard-js
Ready to be a universal clipboard library for all platforms.
中文|English
How to use
very simple
const { readText, writeText, FORMAT_FILE_URL } = require('../index.js')
console.log(readText(), 'result')
console.log(readText(FORMAT_FILE_URL), 'file path result')
console.log(
writeText(
'file:///Users/ZhangXiaohua/Documents/LearningMaterials/C++FromEntryToGrave.pdf',
FORMAT_FILE_URL
),
'writeText result'
)
API
export function clear(): void
export function readBuffer(format?: string): Buffer
export function writeBuffer(data: Buffer, format?: string): boolean
export function readText(format?: string): string
export function writeText(text: string, format?: string): boolean
export const FORMAT_PLAIN_TEXT: string
export const FORMAT_FILE_URL: string
TODO
Support