diff --git a/lib/index.ts b/lib/index.ts index f983e299..25aed03c 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -4,7 +4,7 @@ import FormData from "form-data"; import { createReadStream } from "node:fs"; import { Readable } from "node:stream"; -import process from "node:process"; +import { env } from "node:process"; import { SagiriClientError, SagiriServerError } from "./errors"; import { IResponse, IResult } from "./response"; @@ -23,7 +23,7 @@ const sagiri = (token: string, defaultOptions: IOptions = { results: 5 }): (file // do some token validation, tokens must be 40 chars long and alphanumeric // make sure we're lenient during testing though to allow jest to pass. - if (process.env.NODE_ENV !== "test") + if (env.NODE_ENV !== "test") if (token.length < 40 || !/^[a-zA-Z0-9]+$/.test(token)) throw new Error("Malformed SauceNAO Token. Fetch your own at https://saucenao.com/user.php"); diff --git a/package.json b/package.json index 336ee810..fe546c03 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "license": "MIT", "type": "module", "exports" : { - "require" : "dist/cjs/index.js", - "import" : "dist/esm/index.js" + "require" : "./dist/cjs/index.js", + "import" : "./dist/esm/index.js" }, "main": "dist/cjs/index.js", "contributors": [