diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-13 15:14:35 -0600 |
---|---|---|
committer | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-13 15:14:35 -0600 |
commit | fe139bf26b5f76db3b3e9a351300129c2497b967 (patch) | |
tree | 76200ab67499cd447d0826a755808a1a7f275fff | |
parent | 3ea2cf7db30bbe78748e1b9103fbe9cc9e915b0f (diff) | |
download | skyblock-api-fe139bf26b5f76db3b3e9a351300129c2497b967.tar.gz skyblock-api-fe139bf26b5f76db3b3e9a351300129c2497b967.tar.bz2 skyblock-api-fe139bf26b5f76db3b3e9a351300129c2497b967.zip |
add dotenv as dev dependency
-rw-r--r-- | package-lock.json | 6 | ||||
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | src/hypixelApi.ts | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/package-lock.json b/package-lock.json index f2233b8..acc2a15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,6 +86,12 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==", + "dev": true + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", diff --git a/package.json b/package.json index 53da9f9..fa8155a 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,8 @@ "express": "^4.17.1", "node-cache": "^5.1.2", "node-fetch": "^2.6.1" + }, + "devDependencies": { + "dotenv": "^8.2.0" } } diff --git a/src/hypixelApi.ts b/src/hypixelApi.ts index cb8f0e0..2f66343 100644 --- a/src/hypixelApi.ts +++ b/src/hypixelApi.ts @@ -4,7 +4,10 @@ import fetch from 'node-fetch' import { jsonToQuery, shuffle } from './util' import { Agent } from 'https' -require('dotenv').config() + +if (!process.env.hypixel_keys) + // if there's no hypixel keys in env, run dotenv + require('dotenv').config() // We need to create an agent to prevent memory leaks and to only do dns lookups once const httpsAgent = new Agent({ |