Skip to content

Instantly share code, notes, and snippets.

View imhuwq's full-sized avatar
🎯
Focusing

imhuwq imhuwq

🎯
Focusing
View GitHub Profile
@imhuwq
imhuwq / console.save.js
Created March 12, 2020 04:24 — forked from raecoo/console.save.js
Save JSON object to file in Chrome Devtool
// e.g. console.save({hello: 'world'})
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
if(typeof data === "object"){
data = JSON.stringify(data, undefined, 4)