Skip to content

Commit 62da5ff

Browse files
committed
updated my readme. more:
"oh **just** replace require() with `import`. it'll be fine" - have to set your package to be a module in package.json - __dirname breaks - esno breaks yeah… i'm just downgrading. thanks for the offer.
1 parent 08fa410 commit 62da5ff

File tree

4 files changed

+27
-33
lines changed

4 files changed

+27
-33
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
### 2021
88

99
- Total Score: 53
10-
- Times On Leaderboard: 3 / 20 (~15%)
10+
- Times On Leaderboard: 3 / 22 (~14%)
1111
- Best Leaderboard Position: 62ⁿᵈ place
1212
- Worst Leaderboard Position: 1688ᵗʰ place
1313
- Best Day was Day 2: 39 points, #178/#62
1414

1515
| Day | Time | Rank | Score | Time | Rank | Score |
1616
| --: | -------: | ---: | ----: | -------: | ---: | ----: |
17+
| 13 | 00:14:31 | 946 | | 00:16:11 | 504 | |
1718
| 12 | 00:06:39 | 103 | | 00:12:40 | 100 | 1 |
1819
| 11 | 00:15:41 | 755 | | 00:17:44 | 682 | |
1920
| 10 | 00:04:42 | 192 | | 00:10:38 | 287 | |

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"devDependencies": {
1212
"@types/node": "^16.11.12",
13-
"node-fetch": "^3.1.0",
13+
"node-fetch": "2",
1414
"onchange": "^7.1.0",
1515
"prettier": "^2.5.1",
1616
"typescript": "^4.5.3"

setup.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const fs = require("fs");
22
const path = require("path");
33
// eslint-disable-next-line
4+
const fetch = require("node-fetch");
45

56
let soln_day = process.argv[3];
67

@@ -55,7 +56,7 @@ const interval = setInterval(() => {
5556

5657
setTimeout(async () => {
5758
console.log("\nWait over! Fetching…");
58-
const input_text = await (await (await import("node-fetch").default)("https://adventofcode.com/"+year+"/day/"+soln_day+"/input", {
59+
const input_text = await (await fetch("https://adventofcode.com/"+year+"/day/"+soln_day+"/input", {
5960
headers: {"Cookie": cookietext},
6061
})).text();
6162
fs.writeFileSync(txtfile_path, input_text, "utf-8");

yarn.lock

+22-30
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ cross-spawn@^7.0.1, cross-spawn@^7.0.3:
8787
shebang-command "^2.0.0"
8888
which "^2.0.1"
8989

90-
data-uri-to-buffer@^4.0.0:
91-
version "4.0.0"
92-
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b"
93-
integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==
94-
9590
9691
version "0.13.15"
9792
resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz#3fc3ff0bab76fe35dd237476b5d2b32bb20a3d44"
@@ -240,27 +235,13 @@ execa@^5.1.1:
240235
signal-exit "^3.0.3"
241236
strip-final-newline "^2.0.0"
242237

243-
fetch-blob@^3.1.2:
244-
version "3.1.3"
245-
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.3.tgz#a7dca4855e39d3e3c5a1da62d4ee335c37d26012"
246-
integrity sha512-ax1Y5I9w+9+JiM+wdHkhBoxew+zG4AJ2SvAD1v1szpddUIiPERVGBxrMcB2ZqW0Y3PP8bOWYv2zqQq1Jp2kqUQ==
247-
dependencies:
248-
web-streams-polyfill "^3.0.3"
249-
250238
fill-range@^7.0.1:
251239
version "7.0.1"
252240
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
253241
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
254242
dependencies:
255243
to-regex-range "^5.0.1"
256244

257-
formdata-polyfill@^4.0.10:
258-
version "4.0.10"
259-
resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423"
260-
integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==
261-
dependencies:
262-
fetch-blob "^3.1.2"
263-
264245
fsevents@~2.3.2:
265246
version "2.3.2"
266247
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
@@ -363,14 +344,12 @@ mimic-fn@^2.1.0:
363344
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
364345
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
365346

366-
node-fetch@^3.1.0:
367-
version "3.1.0"
368-
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.1.0.tgz#714f4922dc270239487654eaeeab86b8206cb52e"
369-
integrity sha512-QU0WbIfMUjd5+MUzQOYhenAazakV7Irh1SGkWCsRzBwvm4fAhzEUaHMJ6QLP7gWT6WO9/oH2zhKMMGMuIrDyKw==
347+
node-fetch@2:
348+
version "2.6.6"
349+
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89"
350+
integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==
370351
dependencies:
371-
data-uri-to-buffer "^4.0.0"
372-
fetch-blob "^3.1.2"
373-
formdata-polyfill "^4.0.10"
352+
whatwg-url "^5.0.0"
374353

375354
normalize-path@^3.0.0, normalize-path@~3.0.0:
376355
version "3.0.0"
@@ -462,6 +441,11 @@ to-regex-range@^5.0.1:
462441
dependencies:
463442
is-number "^7.0.0"
464443

444+
tr46@~0.0.3:
445+
version "0.0.3"
446+
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
447+
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=
448+
465449
tree-kill@^1.2.2:
466450
version "1.2.2"
467451
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
@@ -472,10 +456,18 @@ typescript@^4.5.3:
472456
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.3.tgz#afaa858e68c7103317d89eb90c5d8906268d353c"
473457
integrity sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ==
474458

475-
web-streams-polyfill@^3.0.3:
476-
version "3.2.0"
477-
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz#a6b74026b38e4885869fb5c589e90b95ccfc7965"
478-
integrity sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==
459+
webidl-conversions@^3.0.0:
460+
version "3.0.1"
461+
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
462+
integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=
463+
464+
whatwg-url@^5.0.0:
465+
version "5.0.0"
466+
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
467+
integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0=
468+
dependencies:
469+
tr46 "~0.0.3"
470+
webidl-conversions "^3.0.0"
479471

480472
which@^2.0.1:
481473
version "2.0.2"

0 commit comments

Comments
 (0)