Giter VIP home page Giter VIP logo

pb's Introduction

pb

Improved pbcopy/pbpaste for OSX

The standard pbcopy and pbpaste utilities can manipulate the plaintext clipboard but have no easy way of accessing the HTML pasteboard. This module and CLI tool provide a more convenient way to access the pasteboard from node.

Command-Line Tool Usage

To get data from a specific pasteboard:

$ npx pb [type]
$ npx pb -m <type>

To set a specific pasteboard, pipe data into pb:

$ get_data | npx pb -s [type]

To list available pasteboards:

$ npx pb -l

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

$ npx pb -m html | npx pb -s

Library Usage

From node, pb exposes:

  • get(type): get pasteboard data from specified pasteboard
  • set(type, data): set pasteboard data (overwrites other pasteboards)
  • available(): enumerate available pasteboards

This example gets the pasteboard HTML data and copies to plaintext pasteboard:

var pb = require('pb');
var HTMLOutput = pb.get('html');
pb.set('text', HTMLOutput);

Supported Pasteboards

type description
NSStringPboardType plaintext
NSHTMLPboardType HTML
NSRTFPboardType RTF

License

Please consult the attached LICENSE file for details. All rights not explicitly granted by the Apache 2.0 license are reserved by the Original Author.

Analytics

pb's People

Contributors

fgribreau avatar sheetjsdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pb's Issues

Install pb globally or locally

Thank you for the great tool!

Question: how to install the pb package: locally or globally?

npm install -g pb

or it does not matter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.