{"_id":"@brandonxiang/copy-paste","name":"@brandonxiang/copy-paste","dist-tags":{"latest":"1.5.4"},"versions":{"1.5.4":{"name":"@brandonxiang/copy-paste","version":"1.5.4","description":"A command line utility that allows read/write (i.e copy/paste) access to the system clipboard.","keywords":["copy","paste","copy and paste","clipboard"],"maintainers":[{"name":"brandonxiang","email":"1132500533@qq.com"}],"main":"./index.js","repository":{"type":"git","url":"git+https://github.com/xavi-/node-copy-paste.git"},"dependencies":{"iconv-lite":"^0.4.8"},"devDependencies":{"mocha":"*","should":">=8.2.1"},"scripts":{"test":"mocha -w"},"_id":"@brandonxiang/copy-paste@1.5.4","gitHead":"368df468ee6d88d56dd9637f70b53cad11eacc34","bugs":{"url":"https://github.com/xavi-/node-copy-paste/issues"},"homepage":"https://github.com/xavi-/node-copy-paste#readme","_nodeVersion":"20.15.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-OT0nm3rUM9jA9RfH84zlvSkhhNmsO+9G6eIl/9YSDnZiZ3lGtANiPmkSGnTsdD7KwrkC4Z9XSWokpIhmfWC4IQ==","shasum":"f78ca38d6164890f4d74ac653eb849cd9c420d3b","tarball":"https://registry.npmjs.org/@brandonxiang/copy-paste/-/copy-paste-1.5.4.tgz","fileCount":10,"unpackedSize":11232,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpJYLkv0kS5iPFlGjQMJbs3zJdFODpPiiC8Ok2+19NvwIgMKShWb8b6ffqqwB9NpgB/DpJ6x0BA6/BF7wP5vTnCNs="}]},"_npmUser":{"name":"brandonxiang","email":"1132500533@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/copy-paste_1.5.4_1730774132600_0.4741431829328022"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-05T02:35:32.500Z","1.5.4":"2024-11-05T02:35:32.776Z","modified":"2024-11-05T02:35:33.063Z"},"maintainers":[{"name":"brandonxiang","email":"1132500533@qq.com"}],"description":"A command line utility that allows read/write (i.e copy/paste) access to the system clipboard.","homepage":"https://github.com/xavi-/node-copy-paste#readme","keywords":["copy","paste","copy and paste","clipboard"],"repository":{"type":"git","url":"git+https://github.com/xavi-/node-copy-paste.git"},"bugs":{"url":"https://github.com/xavi-/node-copy-paste/issues"},"readme":"# node-copy-paste\n\nA command line utility that allows read/write (i.e copy/paste) access to the system clipboard.  It does this by wrapping [`pbcopy/pbpaste`](https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/pbcopy.1.html) (for OSX), [`xclip`](http://www.cyberciti.biz/faq/xclip-linux-insert-files-command-output-intoclipboard/) (for Linux, FreeBSD, and OpenBSD), and [`clip`](http://www.labnol.org/software/tutorials/copy-dos-command-line-output-clipboard-clip-exe/2506/) (for Windows). Currently works with node.js v0.8+.\n\n## The API\n\nWhen `require(\"copy-paste\")` is executed, an object with the following properties is returned:\n\n- `copy(text[, callback])`: asynchronously replaces the current contents of the clip board with `text`.  Takes either a string, array, object, or readable stream.  Returns the same value passed in. Optional callback will fire when the copy operation is complete.\n- `paste([callback])`: if no callback is provided, `paste` synchronously returns the current contents of the system clip board.  Otherwise, the contents of the system clip board are passed to the callback as the second parameter. The first one being a potential error.\n\n\t**Note**: The synchronous version of `paste` is not always available.  Unfortunately, I'm having a hard time finding a synchronous version of `child_process.exec` that consistently works on all platforms, especially windows.  An error message is shown if the synchronous version of `paste` is used on an unsupported platform.  That said, the asynchronous version of `paste` is always available.\n\n- `require(\"copy-paste\").global()`:  adds `copy` and `paste` to the global namespace.  Returns an object with `copy` and `paste` as properties.\n\n## Example\n\n```js\nvar ncp = require(\"copy-paste\");\n\nncp.copy('some text', function () {\n  // complete...\n})\n```\n\n## Getting node-copy-paste\n\nThe easiest way to get node-copy-paste is with [npm](http://npmjs.org/):\n\n\tnpm install -g copy-paste\n\nAlternatively you can clone this git repository:\n\n\tgit clone git://github.com/xavi-/node-copy-paste.git\n\n## Future plans\n\nI'm hoping to add various fallbacks for instances when `xclip` or `clip` is not avaiable (see [experimental-fallbacks](https://github.com/xavi-/node-copy-paste/tree/experimental-fallbacks/platform) branch).  Also this library needs to be more thoroughly tested on windows.\n\n## Developed by\n* Xavi Ramirez\n\n## License\nThis project is released under [The MIT License](http://www.opensource.org/licenses/mit-license.php).\n","readmeFilename":"README.md"}