{"id":33190030,"url":"https://github.com/toblu/advent-of-code-client","last_synced_at":"2026-01-12T01:52:43.242Z","repository":{"id":45167223,"uuid":"318752965","full_name":"toblu/advent-of-code-client","owner":"toblu","description":"A NodeJS client for fetching inputs and submitting answers to Advent Of Code directly from your JavaScript code","archived":false,"fork":false,"pushed_at":"2022-12-10T09:17:27.000Z","size":96,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-23T19:03:30.550Z","etag":null,"topics":["advent-of-code","aoc","javascript","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toblu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-05T09:50:45.000Z","updated_at":"2024-12-10T05:05:10.000Z","dependencies_parsed_at":"2023-01-26T05:15:45.746Z","dependency_job_id":null,"html_url":"https://github.com/toblu/advent-of-code-client","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/toblu/advent-of-code-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toblu%2Fadvent-of-code-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toblu%2Fadvent-of-code-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toblu%2Fadvent-of-code-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toblu%2Fadvent-of-code-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toblu","download_url":"https://codeload.github.com/toblu/advent-of-code-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toblu%2Fadvent-of-code-client/sbom","scorecard":{"id":890962,"data":{"date":"2025-08-11","repo":{"name":"github.com/toblu/advent-of-code-client","commit":"f4b8f1d1511e3546ee64cfdd1fe929137aed5f53"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T11:49:03.427Z","repository_id":45167223,"created_at":"2025-08-24T11:49:03.427Z","updated_at":"2025-08-24T11:49:03.427Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["advent-of-code","aoc","javascript","typescript"],"created_at":"2025-11-16T06:00:28.441Z","updated_at":"2026-01-12T01:52:43.236Z","avatar_url":"https://github.com/toblu.png","language":"TypeScript","funding_links":[],"categories":["Tools and Utilities"],"sub_categories":[],"readme":"# advent-of-code-client\n\nA NodeJS client for fetching inputs, running puzzle challenges and submitting answers to Advent Of Code directly from your JavaScript code.\n\n## Installation\n\n```\nnpm i --save advent-of-code-client\n```\n\n## How to use\n\nInitializing the client:\n\n```javascript\nimport { AocClient } from 'advent-of-code-client';\n\nconst client = new AocClient({\n  year: 2020, // the year of the challenge\n  day: 1, // the day of the challenge\n  token: 'MY_SESSION_COOKIE' // the session cookie from adventofcode.com\n});\n```\n\nFetching the puzzle input:\n\n```javascript\nconst input = await client.getInput();\n```\n\nSubmitting answer to a part of the puzzle, in this example part 1:\n\n```javascript\nconst success = await client.submit(1, 'myAnswer');\n```\n\nAutomatically running the puzzle parts and submitting the answers:\n\n```javascript\nconst part1 = (input) =\u003e {\n  // ...do part 1\n  return answer;\n};\n\nconst part2 = (input) =\u003e {\n  // ...do part 2\n  return answer;\n};\n\n// true as the second argument means that the answers returned from each part will be automatically submitted\nawait client.run([part1, part2], true);\n```\n\nTransforming inputs before they are returned from `.getInput()`. This can be especially useful if you are running your puzzle parts automatically. When using the `.setInputTransform(transform)` method, the input to each part function will be the transformed / parsed data.\n\nFor convenience there are a couple of pre-defined transform functions for commonly used transformations (i.e. splitting data by lines). The pre-defined transform functions are exported as `transforms`:\n\n```javascript\nimport { transforms } from 'advent-of-code-client';\n\nclient.setInputTransform(transforms.lines);\n```\n\nYou can also specify your own transform function:\n\n```javascript\n\nconst myTransform = rawData =\u003e {\n  ... // transform data\n  return transformedData;\n}\n\nclient.setInputTransform(myTransform);\n```\n\n## Authentication\n\nTo be able to fetch inputs and submit answers, you must authenticate against adventofcode.com using the value from your session cookie. You can find it among your browser cookies. Pass it in as the value for the `token` attribute when you initialize the client.\n\n## Caching\n\nTo prevent unnecessary load on advent-of-code servers, all the requests are cached. So if you for example have previously submitted an incorrect answer and try to submit the same answer again, the client will just return the cached response instead of calling adventofcode.com again.\n\nIf you for some reason need to prevent the client from using the cache, you should set the `useCache` to false when initializing the client (use with caution).\n\n```javascript\nconst client = new AocClient({\n  ..., // other options\n  useCache: false\n})\n```\n\n## Disclaimer\n\nThis is not an official tool for Advent Of Code and I am not in any way affiliated or in cooperation with adventofcode.com. I am a happy user who myself participate in the Advent Of Code challenges, and I wanted to make a tool that would help with fetching inputs and submitting answers.\n\nI created this primarily as a tool for myself to make it easier to work on the Advent Of Code challenges, and decided to share it hoping hat it might help someone else as well. It has worked well for my workflow, however I'm not actively using / maintaining this tool and it might contain bugs. I take no responsibility for any problems that occur either due to misuse or to bugs in the tool. Please keep that in mind in case you decide to use it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoblu%2Fadvent-of-code-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoblu%2Fadvent-of-code-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoblu%2Fadvent-of-code-client/lists"}