A command line utility that allows read/write (i.e copy/paste) access to the system clipboard.
支持OSX、Linux、Windows
另一个下载量更大的库:clipboardy
文档
安装
npm install copy-paste
示例
import ncp from "copy-paste";
// 向剪切板写入内容
ncp.copy("some text", function () {
// complete...
});
// 从剪切板读取内容
let res = ncp.paste();
console.log(res);