Skip to content

Commit 874371b

Browse files
committed
import fs dynamically
1 parent ef15aaf commit 874371b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import fetch from "node-fetch";
2-
import fs from "fs";
32
import { encode } from "blurhash";
43
import sharp from 'sharp';
54
import sizeOf from "image-size";
@@ -42,6 +41,7 @@ export const blurhashFromURL = async (source: string, options: IOptions = {}): P
4241
let width, height, returnedBuffer;
4342

4443
if (offline) {
44+
const fs = await import("fs");
4545
const { width: localWidth, height: localHeight } = sizeOf(source);
4646
width = localWidth;
4747
height = localHeight;

0 commit comments

Comments
 (0)