

A TS library for Advent of Code.
It was primarily developed to build the
@bryan-hoang/aoc-cli
command-line tool, but it can also be integrated into other projects.
# ✨ Auto-detect
npx nypm install @bryan-hoang/aoc-client
# npm
npm install @bryan-hoang/aoc-client
# yarn
yarn add @bryan-hoang/aoc-client
# pnpm
pnpm install @bryan-hoang/aoc-client
# bun
bun install @bryan-hoang/aoc-client
# deno
deno install @bryan-hoang/aoc-client
Importing:
ESM (Node.js, Bun, Deno)
import { AocClientBuilder, AocClient } from "@bryan-hoang/aoc-client";
CommonJS (Legacy Node.js)
const { AocClientBuilder, AocClient } = require("@bryan-hoang/aoc-client");
CDN (Deno, Bun and Browsers)
import {
AocClientBuilder,
AocClient,
} from "https://esm.sh/@bryan-hoang/aoc-client";
API:
Method |
Type |
buildClient |
() => AocClient |
Method |
Type |
#validateBuild |
() => asserts this is this and { _sessionCookie: string; _year: number; _day: number; } |
⚙️ getSessionCookieFromDefaultLocations
Method |
Type |
getSessionCookieFromDefaultLocations |
() => AocClientBuilder |
⚙️ getSessionCookieFromFile
Method |
Type |
getSessionCookieFromFile |
(file: string) => AocClientBuilder |
⚙️ getDefaultSessionCookieFile
Method |
Type |
getDefaultSessionCookieFile |
() => string |
Method |
Type |
sessionCookie |
(sessionCookie: string) => AocClientBuilder |
Method |
Type |
year |
(year: number) => AocClientBuilder |
Method |
Type |
day |
(day: number) => AocClientBuilder |
Method |
Type |
latestPuzzleDay |
() => AocClientBuilder |
Method |
Type |
latestEventYear |
() => AocClientBuilder |
Method |
Type |
overwriteFiles |
(overwriteFiles: boolean) => AocClientBuilder |
Method |
Type |
getBuilder |
() => AocClientBuilder |
Method |
Type |
ensureDayUnlocked |
() => void |
Method |
Type |
isDayUnlocked |
() => boolean |
@bryan-hoang
PRs accepted.
Small note: if editing the README, please conform to the
standard-readme specification.
MIT © 2024 Bryan Hoang
🤖 auto updated with automd