{"id":20718557,"url":"https://github.com/5rahim/gojadoc","last_synced_at":"2026-05-14T12:31:58.535Z","repository":{"id":261637673,"uuid":"884904479","full_name":"5rahim/gojadoc","owner":"5rahim","description":"Goja bindings for HTML parsing.","archived":false,"fork":false,"pushed_at":"2024-11-07T15:54:15.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-16T03:57:41.631Z","etag":null,"topics":["cheerio","goja","goquery","jquery"],"latest_commit_sha":null,"homepage":"","language":"Go","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/5rahim.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-07T15:43:09.000Z","updated_at":"2024-11-07T15:54:18.000Z","dependencies_parsed_at":"2024-11-07T16:53:23.048Z","dependency_job_id":null,"html_url":"https://github.com/5rahim/gojadoc","commit_stats":null,"previous_names":["5rahim/gojadoc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/5rahim/gojadoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5rahim%2Fgojadoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5rahim%2Fgojadoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5rahim%2Fgojadoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5rahim%2Fgojadoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5rahim","download_url":"https://codeload.github.com/5rahim/gojadoc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5rahim%2Fgojadoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33024919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cheerio","goja","goquery","jquery"],"created_at":"2024-11-17T03:13:59.233Z","updated_at":"2026-05-14T12:31:58.512Z","avatar_url":"https://github.com/5rahim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gojadoc\n\nGoja bindings for HTML parsing inspired by Cheerio.\n\n```go\npackage main\n\nimport (\n\t\"github.com/dop251/goja\"\n\t\n\t\"github.com/5rahim/gojadoc\"\n)\n\nfunc main() {\n\tvm := goja.New()\n\t\n    err := gojadoc.BindDocument(vm)\n    if err != nil {\n\t\tpanic(err)\n    }\n}\n```\n\n```ts\nconst html = `\n\u003cbody\u003e\n    \u003csection id=\"content\"\u003e\n        \u003carticle class=\"post\" data-id=\"1\"\u003e\n            \u003ch2\u003eFirst Post\u003c/h2\u003e\n            \u003cp\u003eThis is the first post.\u003c/p\u003e\n            \u003ca href=\"https://example.com/first-post\" class=\"read-more\"\u003eRead more\u003c/a\u003e\n        \u003c/article\u003e\n        \u003carticle class=\"post\" data-id=\"2\"\u003e\n            \u003ch2\u003eSecond Post\u003c/h2\u003e\n            \u003cp\u003eThis is the second post.\u003c/p\u003e\n            \u003ca href=\"https://example.com/second-post\" class=\"read-more\"\u003eRead more\u003c/a\u003e\n        \u003c/article\u003e\n        \u003carticle class=\"post\" data-id=\"3\"\u003e\n            \u003ch2\u003eThird Post\u003c/h2\u003e\n            \u003cp\u003eThis is the third post.\u003c/p\u003e\n            \u003ca href=\"https://example.com/third-post\" class=\"read-more\"\u003eRead more\u003c/a\u003e\n        \u003c/article\u003e\n    \u003c/section\u003e\n\u003c/body\u003e\n\u003c/html\u003e`\n\nconst $ = new Doc(html)\nconst titles = $.find(\"section\")\n\t.children(\"article.post\")\n\t.filter((i, e) =\u003e {\n\t\treturn e.attr(\"data-id\") !== \"1\"\n\t})\n\t.map((i, e) =\u003e {\n\t\treturn e.children(\"h2\").text()\n\t})\n```\n\n---\n\n```ts\n// doc.d.ts\ndeclare class DocSelection {\n    // Retrieves the value of the specified attribute for the first element in the DocSelection.\n    // To get the value for each element individually, use a looping construct such as each or map.\n    attr(name: string): string | undefined;\n\n    // Returns an object containing the attributes of the first element in the DocSelection.\n    attrs(): { [key: string]: string };\n\n    // Gets the child elements of each element in the DocSelection, optionally filtered by a selector.\n    children(selector?: string): DocSelection;\n\n    // For each element in the DocSelection, gets the first ancestor that matches the selector by testing the element itself\n    // and traversing up through its ancestors in the DOM tree.\n    closest(selector?: string): DocSelection;\n\n    // Gets the children of each element in the DocSelection, including text and comment nodes.\n    contents(): DocSelection;\n\n    // Gets the children of each element in the DocSelection, filtered by the specified selector.\n    contentsFiltered(selector: string): DocSelection;\n\n    // Gets the value of a data attribute for the first element in the DocSelection.\n    // If no name is provided, returns an object containing all data attributes.\n    data\u003cT extends string | undefined\u003e(name?: T): T extends string ? (string | undefined) : { [key: string]: string };\n\n    // Iterates over each element in the DocSelection, executing a function for each matched element.\n    each(callback: (index: number, element: DocSelection) =\u003e void): DocSelection;\n\n    // Ends the most recent filtering operation in the current chain and returns the set of matched elements to its previous state.\n    end(): DocSelection;\n\n    // Reduces the set of matched elements to the one at the specified index. If a negative index is given, it counts backwards starting at the end\n    // of the set.\n    eq(index: number): DocSelection;\n\n    // Filters the set of matched elements to those that match the selector.\n    filter(selector: string | ((index: number, element: DocSelection) =\u003e boolean)): DocSelection;\n\n    // Gets the descendants of each element in the DocSelection, filtered by a selector.\n    find(selector: string): DocSelection;\n\n    // Reduces the set of matched elements to the first element in the DocSelection.\n    first(): DocSelection;\n\n    // Reduces the set of matched elements to those that have a descendant that matches the selector.\n    has(selector: string): DocSelection;\n\n    // Gets the combined text contents of each element in the DocSelection, including their descendants.\n    text(): string;\n\n    // Gets the HTML contents of the first element in the DocSelection.\n    html(): string | null;\n\n    // Checks the set of matched elements against a selector and returns true if at least one of these elements matches.\n    is(selector: string | ((index: number, element: DocSelection) =\u003e boolean)): boolean;\n\n    // Reduces the set of matched elements to the last element in the DocSelection.\n    last(): DocSelection;\n\n    // Gets the number of elements in the DocSelection.\n    length(): number;\n\n    // Passes each element in the current matched set through a function, producing an array of the return values.\n    map\u003cT\u003e(callback: (index: number, element: DocSelection) =\u003e T): T[];\n\n    // Gets the next sibling of each element in the DocSelection, optionally filtered by a selector.\n    next(selector?: string): DocSelection;\n\n    // Gets all following siblings of each element in the DocSelection, optionally filtered by a selector.\n    nextAll(selector?: string): DocSelection;\n\n    // Gets the next siblings of each element in the DocSelection, up to but not including the element matched by the selector.\n    nextUntil(selector: string, until?: string): DocSelection;\n\n    // Removes elements from the DocSelection that match the selector.\n    not(selector: string | ((index: number, element: DocSelection) =\u003e boolean)): DocSelection;\n\n    // Gets the parent of each element in the DocSelection, optionally filtered by a selector.\n    parent(selector?: string): DocSelection;\n\n    // Gets the ancestors of each element in the DocSelection, optionally filtered by a selector.\n    parents(selector?: string): DocSelection;\n\n    // Gets the ancestors of each element in the DocSelection, up to but not including the element matched by the selector.\n    parentsUntil(selector: string, until?: string): DocSelection;\n\n    // Gets the previous sibling of each element in the DocSelection, optionally filtered by a selector.\n    prev(selector?: string): DocSelection;\n\n    // Gets all preceding siblings of each element in the DocSelection, optionally filtered by a selector.\n    prevAll(selector?: string): DocSelection;\n\n    // Gets the previous siblings of each element in the DocSelection, up to but not including the element matched by the selector.\n    prevUntil(selector: string, until?: string): DocSelection;\n\n    // Gets the siblings of each element in the DocSelection, optionally filtered by a selector.\n    siblings(selector?: string): DocSelection;\n}\n\ndeclare class Doc extends DocSelection {\n    constructor(html: string);\n}\n\ndeclare function LoadDoc(html: string): DocSelectionFunction;\n\ndeclare interface DocSelectionFunction {\n    (selector: string): DocSelection;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5rahim%2Fgojadoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5rahim%2Fgojadoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5rahim%2Fgojadoc/lists"}