Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including pasty-clipboard-editor with all npm packages installed. Try it out:

var pastyClipboardEditor = require("pasty-clipboard-editor")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

pasty-clipboard-editor v1.1.3

Edits the text on your clipboard

Pasty - The Clipboard Editor

Edit the text directly on your clipboard (paste bin/whatever) with some built in functions.

Installation

npm install pasty-clipboard-editor

Usage

pasty-clipboard-editor will install a global command pasty to your bin which will be accessible via the command prompt (or run box if you're on Windows). You have some text on your clipboard, and you can call one of the built in functions, or one of your own saved functions and your text is updated.

Built-in commands are:

CommandDescription
repreplaces with a regular expression
capcapitalizes or lower cases
columnAlignAligns delimited data by column
countcounts characters or lines
dedupDeduplicates a list
urlencodeencode/decode a url/xml/base64
grepyou know, GREP...
helpgets help on functions
insertconverts a delimited text to SQL insert statement
newidgenerates a new UUID
repreplaces with a RegExp
setTextsets the content to the passed in string
sortSorts a list
xmlPretty prints xml inside the string

You can also define your own functions comprised of a set of the above list in a local ~/pasty.json file. An example file is given in the repository.

Pasty will also work via a shell pipe, so echo "test" | pasty rep s x will output text. This is very useful in text editors that work with stdio like VIM.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free