https://github.com/aod/aoc-runner.js
A tool for running Advent of Code solutions written JavaScript/NodeJS
https://github.com/aod/aoc-runner.js
Last synced: 8 months ago
JSON representation
A tool for running Advent of Code solutions written JavaScript/NodeJS
- Host: GitHub
- URL: https://github.com/aod/aoc-runner.js
- Owner: aod
- License: unlicense
- Created: 2019-04-10T12:19:32.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T23:45:21.000Z (over 4 years ago)
- Last Synced: 2025-10-14T17:17:51.005Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aoc-runner.js
Install:
```
npm i aod/aoc-runner.js
```
# Usage
```
SYNTAX:
npx aoc-runner [-v] {[:][,...year].[,...day].[,...part]} [repeat]
USAGE:
-v : enables verboseness i.e. displays warning messages.
args[0] : the solution to run.
e.g. ".1,2,3,7.1" will run day 1, 2, 3 & 7 part 1 for
all the years.
To select a range of values use "-".
e.g. ".1-3,7-22.1"
To exclude solutions use the optional ":" notation after
the first date.
e.g. .1-3,7.1:2017.2-5 will exclude day 2 through 5
for year 2017.
args[1] repeat : repeats every solution matched N times.
```
# Quick start
Create `aoc-runner.config.js` in the root of your project.
## Usage
```ts
// file: /aoc-runner.config.js
module.exports = {
// AoC solution file resolver (per part):
path: string | {
year: string | (year: number) => string
day: string | (day: number) => string
part: string | (part: number) => string
},
// The input path relative to the resolved solution path:
input: string
}
```
Example:
```js
// file: /aoc-runner.config.js
module.exports = {
// Using a string:
path: '$/day$/part$.js',
// Using a custom resolver object:
path: {
day: ({ day }) => `day${('' + day).padStart(2, '0')}`,
part: 'part$.js'
},
input: './input.txt'
}
```