Skip to content

Commit

Permalink
Update code for import failure
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Fan <[email protected]>
  • Loading branch information
stevefan1999-personal committed Jul 29, 2024
1 parent 688b5d8 commit a112ed2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/_loadurl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
// ctors). so we utilize `spawnSync` to spawn this program as a child process.
// alternatively we could have use `curl` but this is more portable.

import { http, https } from 'follow-redirects';
import { parse } from 'url';
import { lstatSync, createReadStream } from 'fs';
import * as followRedirects from 'follow-redirects';
import { parse } from 'node:url';
import { lstatSync, createReadStream } from 'node:fs';
import process from 'node:process'

const { http, https } = followRedirects;

const url = process.argv[2];
if (!url) {
console.error(`Usage: ${process.argv[1]} URL`);
Expand Down

0 comments on commit a112ed2

Please sign in to comment.