Skip to content

Commit 03cc8eb

Browse files
authored
refactor(getData): image fetching to use import syntax (#947)
1 parent 586aa02 commit 03cc8eb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/getData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import millify from "millify";
22
import stats from "./fetcher/stats";
33
import repositoryStats from "./fetcher/repositoryStats";
4-
const base64ImageFetcher = require("node-base64-image");
4+
import { encode } from "node-base64-image";
55

66
/**
77
* Type representing GitHub user information.
@@ -61,7 +61,7 @@ async function getData(username: string): Promise<GetData> {
6161
const output = {
6262
username: user.login,
6363
name: user.name,
64-
picture: await base64ImageFetcher.encode(`${user.avatarUrl}&s=200`, {
64+
picture: await encode(`${user.avatarUrl}&s=200`, {
6565
string: true
6666
}),
6767
public_repos: millify(user.repositories.totalCount),

0 commit comments

Comments
 (0)