{"id":18057371,"url":"https://github.com/1computer1/relevant-xkcd","last_synced_at":"2025-04-11T04:41:12.328Z","repository":{"id":57352846,"uuid":"81288864","full_name":"1Computer1/relevant-xkcd","owner":"1Computer1","description":"Fetches XKCD comics. https://www.npmjs.com/package/relevant-xkcd","archived":false,"fork":false,"pushed_at":"2017-12-08T13:38:49.000Z","size":5,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-03T13:40:06.003Z","etag":null,"topics":["xkcd"],"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/1Computer1.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":"2017-02-08T04:52:38.000Z","updated_at":"2024-10-13T13:15:08.000Z","dependencies_parsed_at":"2022-09-05T11:41:01.395Z","dependency_job_id":null,"html_url":"https://github.com/1Computer1/relevant-xkcd","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/1Computer1%2Frelevant-xkcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Computer1%2Frelevant-xkcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Computer1%2Frelevant-xkcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Computer1%2Frelevant-xkcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1Computer1","download_url":"https://codeload.github.com/1Computer1/relevant-xkcd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345276,"owners_count":21088242,"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":["xkcd"],"created_at":"2024-10-31T02:07:34.315Z","updated_at":"2025-04-11T04:41:12.308Z","avatar_url":"https://github.com/1Computer1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Relevant XKCD\nSimple XKCD comic fetcher.  \nUses Promises and not callbacks!  \n\n## Example\n\n```js\nconst xkcd = require('relevant-xkcd');\nxkcd.fetchRelevant('meta').then(console.log);\n```\n\n## Output\n\n```js\n  {\n    id: 917,\n    day: 27,\n    month: 6,\n    year: 2011,\n    date: 2011-06-27, // Date object.\n    title: 'Hofstadter',\n    safeTitle: 'Hofstadter',\n    transcript: '[...]', // Too long for here!\n    altText: '[...]',\n    xkcdURL: 'https://xkcd.com/917',\n    imageURL: 'https://imgs.xkcd.com/comics/hofstadter.png',\n    explainURL: 'http://www.explainxkcd.com/wiki/index.php/917'\n  }\n```\n\n## Methods\n\n### `xkcd.fetchComic([id])`\nFetches a comic.  \nID can be left blank for current comic.  \n`=\u003e Promise\u003cComic\u003e`  \n\n### `xkcd.fetchCurrent()`\nFetches the current comic.  \n`=\u003e Promise\u003cComic\u003e`  \n\n### `xkcd.fetchRandom()`\nFetches a random comic.  \n`=\u003e Promise\u003cComic\u003e`  \n\n### `xkcd.fetchRelevant(query)`\nFetches a comic relevant to query.  \nUses [Relevant XKCD](https://relevantxkcd.appspot.com/).  \n`=\u003e Promise\u003cComic\u003e`  \n\n### `xkcd.fetchAllRelevant(query)`\nFetches comics relevant to query.  \nComics are sorted by descending relevancy.  \n`=\u003e Promise\u003cComic[]\u003e`  \n\n### `comic.fetchImage()`\nFetches the image buffer of a comic.  \n`=\u003e Promise\u003cBuffer\u003e`  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1computer1%2Frelevant-xkcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1computer1%2Frelevant-xkcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1computer1%2Frelevant-xkcd/lists"}