
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
Framework for working with Advent of Code in typescript
Can be used to structure puzzles as classes
import {AoC} from 'aocf'
export class AoC2020Day1 extends AoC {
partA(input: string):number {
return 95;
}
partB(input: string): number {
return 105;
}
}
// Download data using a $AOC_SESSION and run against your input
new AoC2020Day1.run()
// 2020-12-01: 0.934ms - Duration that the solution run in
// 2020-12-01.Question#1 95 // Answer to Q1
// 2020-12-01.Question#2 105 // Answer to Q2
Or used as a script format
import {AoC} from 'aocf'
const aoc = AoC.create(2020, 1)
const input = await aoc.input
Or as a combination
import {AoC} from 'aocf'
const aoc = AoC.create(2020, 1);
aoc.partA = (d) => {
let total = 0;
for (const line of d.split('\n')) total++;
return total;
};
aoc.run();
All answers and input can be export into a JSON file for sharing
import '@blacha/advent-of-code-2020';
const data = await AoC.export(2020);
writeFileSync(`./aoc-${data.user}-${data.year}.json`, JSON.stringify(data, null, 2));
Format:
export interface AoCJsonData {
/** Github username for where the puzzle data came from */
user: string;
/** Advent of code year */
year: number;
puzzles: {
/** Raw puzzle input */
input: string;
/** Answers for the day */
answers: { a: string | number, b: string | number}
}[]
}
Session and data storage locations can be configured with a .aocrc or environment variables
AOC_SESSION=YourAoCSession
AOC_USER=blacha # github user name
AOC_DATA_PATH=. # Store the .aoc-data folder in the same folder as your .aocrc
export AOC_SESSION=YourAoCSession
FAQs
Framework for working with Advent of Code in typescript
The npm package aocf receives a total of 8 weekly downloads. As such, aocf popularity was classified as not popular.
We found that aocf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.