{"id":18256109,"url":"https://github.com/serapath/dom-console","last_synced_at":"2025-04-04T17:31:48.496Z","repository":{"id":57214631,"uuid":"51934778","full_name":"serapath/dom-console","owner":"serapath","description":"console.log output in the dom","archived":false,"fork":false,"pushed_at":"2017-04-23T16:57:13.000Z","size":359,"stargazers_count":26,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-01T15:07:04.131Z","etag":null,"topics":["browser","console","devtools","dom","dom-console","term","terminal"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/dom-console","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serapath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-17T15:58:05.000Z","updated_at":"2024-09-10T14:00:05.000Z","dependencies_parsed_at":"2022-08-26T13:41:27.103Z","dependency_job_id":null,"html_url":"https://github.com/serapath/dom-console","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serapath%2Fdom-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serapath%2Fdom-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serapath%2Fdom-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serapath%2Fdom-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serapath","download_url":"https://codeload.github.com/serapath/dom-console/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223151354,"owners_count":17096096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","console","devtools","dom","dom-console","term","terminal"],"created_at":"2024-11-05T10:20:00.195Z","updated_at":"2024-11-05T10:20:01.011Z","avatar_url":"https://github.com/serapath.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dom-console\nconsole.log output in the dom\n\n## description\nvery convenient when experimenting with npm libraries in the browser. For example using [requirebin.com](http://requirebin.com/)\n\nBy default.it adds a console DOM element to the bottom of the page, which can be cleared and minimized/maximized via buttons and shows everything that can otherwise be seen in the DevTools JavaScript console.\n\n## example\nsee http://serapath.github.io/dom-console\n\n## usage\n```js\nvar Buffer = require('buffer').Buffer\nvar domconsole = require('dom-console')\nvar opts = { lineLength: 60 } // default\nvar api = /*element*/ domconsole(/*opts*/).api\n\nconsole.log(new Buffer(5))\n\nvar x = { leaf: 'leaf' }\nx['circular1'] = x\nx.y = {}\nx.y.circular2 = x.y\nconsole.log(x)\n\nconsole.log({a:'x', fn:function(x){return 5}})\nconsole.log(new Date)\nconsole.log({a:'b',c:[1,2,3],x:{y:{z:['a',{b:'c'}]}}})\nconsole.log(null)\nconsole.log(undefined)\nconsole.log(\"hey\")\nconsole.log(false)\nconsole.log(true)\nconsole.log(function asdf () {})\nconsole.log(12)\nconsole.log(/asdf/)\nconsole.log((function(){ return arguments })(1,true))\nconsole.log([])\nconsole.log(document.createElement('div'))\nconsole.log(NaN)\n\nconsole.log({a: '5'})\nconsole.error({a: '5'})\nconsole.log(document.createElement('div'))\nconsole.error(document.createElement('div'))\nvar div = document.createElement('div')\ndiv.innerHTML = '\u003cdiv\u003e\u003cdiv\u003easdf\u003c/div\u003e\u003c/div\u003e'\nconsole.log(div)\nconsole.log('WWWWWWWWWW WWWWWWWWWW WWWWWWWWWW WWWWWWWWWW WWWWWWWWWW WWWWWWWWWW WWWWWWWWWW WWWWWWWWWW ')\n\nconsole.info('it works :-)')\n\n// api usage\napi.toggle() // expand or minimize the dom-console\nconsole.log(api.serialize()) // retrieve the log that was logged to the dom-console\napi.clear() // clear the content of the dom-console\n\napi.log('visible in devtools console \u0026 only this dom-console instance')\napi.info('visible in devtools console \u0026 only this dom-console instance')\napi.error('visible in devtools console \u0026 only this dom-console instance')\n\n// also logs errors nicely\nfunction test (p) { var x = JSON.parse(p) }\ntest(function(){})\n\nconsole.log(new Error('Ups! Something wrong...'))\nconsole.error(new Error('Ups! Something wrong...'))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserapath%2Fdom-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserapath%2Fdom-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserapath%2Fdom-console/lists"}