pb

Node interface to OSX Pasteboard

npm install pb
1 downloads in the last week
7 downloads in the last month

pb

Improved pbcopy/pbpaste for OSX

Installation

npm install pb

Usage

$ pb [type]
$ get_data | pb -s [type]

For example, to grab the contents of the html pasteboard and put it on the plaintext pasteboard:

$ pb html | pb -s

From node, pb exposes:

  • get(type): get pasteboard data from specified pasteboard
  • set(type, data): set pasteboard data (overwrites other pasteboards)
var pb = require('pb');
var HTMLOutput = pb.get('html');
var textOutput = pb.get();

Supported Pasteboards

  • NSStringPboardType (plaintext)
  • NSHTMLPboardType (HTML)
npm loves you