pretty-clipboard
v0.0.29
Published
Pretty print the clipboard to console
Downloads
7
Maintainers
Readme
pretty-clipboard
Pretty print JSON like objects found in the clipboard to console.
Also dumps JSON found within strings recursively.
Installation
npm install -g pretty-clipboard
Usage
Say you have some JSON-like string in your clipboard among other text
Some text {'foo': "bar", name: null, count: 1234, bool: true, python: None, "Object": { inner: 1, test: 'string'} } more text
You can pretty print it to the console using inspect with
pc
Gives output
To pretty print a correctly stringified JSON object, use jc
instead (no colours)
jc
Bonus
uc
will unescape the clipboard contents (e.g. \n
to newline, html entities, url encoded characters).
uc
Copy the following text to the clipboard and give it a go
\u2728Hello\u2728
%D1%88%D0%B5%D0%BB%D0%BB%D1%8B
%3Fx%3Dtest\nHello%20World
line1\nline2\nline3\ttabbed
test&test "hey" 'there'
Notes for pc
and jc
Repairs common JSON errors like single quotes, missing quotes, trailing commas, missing commas.
Also repairs quoted keys and values e.g. as used in Kibana logs.