{"id":19730520,"url":"https://github.com/begriffs/objgrep","last_synced_at":"2025-04-30T01:32:52.450Z","repository":{"id":6522932,"uuid":"7763871","full_name":"begriffs/objgrep","owner":"begriffs","description":"Find strings inside complicated javascript objects","archived":false,"fork":false,"pushed_at":"2014-05-12T04:37:48.000Z","size":315,"stargazers_count":160,"open_issues_count":0,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-10T20:20:40.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/begriffs.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":"2013-01-22T23:36:50.000Z","updated_at":"2023-12-26T18:19:35.000Z","dependencies_parsed_at":"2022-09-08T03:00:46.021Z","dependency_job_id":null,"html_url":"https://github.com/begriffs/objgrep","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/begriffs%2Fobjgrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/begriffs%2Fobjgrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/begriffs%2Fobjgrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/begriffs%2Fobjgrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/begriffs","download_url":"https://codeload.github.com/begriffs/objgrep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224192997,"owners_count":17271238,"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":[],"created_at":"2024-11-12T00:16:38.630Z","updated_at":"2024-11-12T00:16:39.208Z","avatar_url":"https://github.com/begriffs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Search inside JavaScript objects\n\n[![Build Status](https://travis-ci.org/begriffs/objgrep.png)](https://travis-ci.org/begriffs/objgrep)\n\nThe command line has `grep`, so why doesn't JavaScript?\n\nIf you work with big objects (such as those in client-side MVC\nlibraries) you might wonder where certain properties end up living on\nyour JS objects. Wouldn't it be nice to just grep the objects to find\nstrings you know are in there somewhere?\n\n### Usage\n\nRun this bookmarklet.\n\n    javascript:(function%20()%20%7Bvar%20script%20=%20document.createElement(%22script%22);script.src%20=%20%22https://raw.github.com/begriffs/objgrep/master/objgrep.js%22;document.getElementsByTagName(%22head%22)[0].appendChild(script);%7D());\n\nIt adds a `.grep` method to every object which you can use in the Chrome\nconsole. **For example** let's define a `foo` object.\n\n    var foo = { beamish: 'thought', outgrabe: 10, toves: ['thou', 'borogoves', 'wabe'] };\n\nAfter running the bookmarklet, you can grep the object:\n\n![Grep for /abe/](illustration/abe.png \"Grep for /abe/\")\n\n    foo.grep(/abe/);\n    // returns [\".outgrabe\", \".toves[2]\"]\n\n![Grep for digits](illustration/digits.png \"Grep for digits\")\n\n    foo.grep(/\\d+/);\n    // returns [\".outgrabe\", \".toves[0]\", \".toves[1]\", \".toves[2]\"]\n\n### Options\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\u003cth\u003ename\u003c/th\u003e\u003cth\u003edescription\u003c/th\u003e\u003cth\u003edefault value\u003c/th\u003e\u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003edepth\u003c/td\u003e\n      \u003ctd\u003eLimit the search depth\u003c/td\u003e\n      \u003ctd\u003e5\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003edom\u003c/td\u003e\n      \u003ctd\u003eSearch dom nodes too\u003c/td\u003e\n      \u003ctd\u003etrue\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ekeys\u003c/td\u003e\n      \u003ctd\u003eSearch in object keys\u003c/td\u003e\n      \u003ctd\u003etrue\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nPass options as a hash in the second argument. For instance,\n\n    // searches with depth at most two\n    foo.grep(/abe/, {depth: 2});\n    // returns [\".outgrabe\"]\n\n### Caveats\n - Clicking the bookmarklet when the debugger is paused in chrome will\n   continue script execution.  Load objgrep in development (via\n  `\u003cscript\u003e` tags) or click the bookmarklet before hitting a breakpoint to\n  work around this.\n\n### License\n\nObjgrep is Copyright © 2013 Joe Nelson. It is free software, and may be\nredistributed under the terms specified in the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbegriffs%2Fobjgrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbegriffs%2Fobjgrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbegriffs%2Fobjgrep/lists"}