Skip to content

Commit d3a5b99

Browse files
committed
Add Copy Some Data From The Console as a chrome til
1 parent e782f0b commit d3a5b99

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010
For a steady stream of TILs from a variety of rocketeers, checkout
1111
[til.hashrocket.com](https://til.hashrocket.com/).
1212

13-
_759 TILs and counting..._
13+
_760 TILs and counting..._
1414

1515
---
1616

@@ -55,6 +55,7 @@ _759 TILs and counting..._
5555
### Chrome
5656

5757
- [Access A Value Logged To The Console](chrome/access-a-value-logged-to-the-console.md)
58+
- [Copy Some Data From The Console](chrome/copy-some-data-from-the-console.md)
5859
- [Duplicate The Current Tab](chrome/duplicate-the-current-tab.md)
5960
- [Easier Access To Network Throttling Controls](chrome/easier-access-to-network-throttling-controls.md)
6061
- [Pretty Print Tabular Data](chrome/pretty-print-tabular-data.md)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copy Some Data From The Console
2+
3+
Sometimes you have some data that you are playing around with in the
4+
console, something you logged from an API response. You then want to share
5+
it, so you try to copy the whole thing into your system copy buffer. There
6+
are a couple hacky ways of doing this, but Chrome supports a really smooth
7+
way.
8+
9+
Use the `copy` function.
10+
11+
```javascript
12+
characters
13+
> (8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
14+
copy(characters[1])
15+
```
16+
17+
My system copy buffer now contains the entire object that makes up the
18+
second entry in that list. I can then paste it into Slack or wherever.
19+
20+
[source](https://twitter.com/addyosmani/status/1092686766375616517)

0 commit comments

Comments
 (0)