read-config-file
Advanced tools
Comparing version 5.0.2 to 6.0.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs_extra_1 = require("fs-extra"); | ||
const fs_1 = require("fs"); | ||
const js_yaml_1 = require("js-yaml"); | ||
@@ -8,3 +8,3 @@ const path = require("path"); | ||
async function readConfig(configFile, request) { | ||
const data = await fs_extra_1.readFile(configFile, "utf8"); | ||
const data = await fs_1.promises.readFile(configFile, "utf8"); | ||
let result; | ||
@@ -60,3 +60,4 @@ if (configFile.endsWith(".json5") || configFile.endsWith(".json")) { | ||
if (packageMetadata == null) { | ||
packageMetadata = await orNullIfFileNotExist(fs_extra_1.readJson(path.join(request.projectDir, "package.json"))); | ||
const json = await orNullIfFileNotExist(fs_1.promises.readFile(path.join(request.projectDir, "package.json"), "utf8")); | ||
packageMetadata = json == null ? null : JSON.parse(json); | ||
} | ||
@@ -102,3 +103,3 @@ const data = packageMetadata == null ? null : packageMetadata[request.packageKey]; | ||
async function loadEnv(envFile) { | ||
const data = await orNullIfFileNotExist(fs_extra_1.readFile(envFile, "utf8")); | ||
const data = await orNullIfFileNotExist(fs_1.promises.readFile(envFile, "utf8")); | ||
if (data == null) { | ||
@@ -105,0 +106,0 @@ return null; |
{ | ||
"name": "read-config-file", | ||
"version": "5.0.2", | ||
"version": "6.0.0", | ||
"main": "out/main.js", | ||
@@ -9,3 +9,3 @@ "author": "Vladimir Krivosheev", | ||
"engines": { | ||
"node": ">=8.12.0" | ||
"node": ">=10.0.0" | ||
}, | ||
@@ -24,5 +24,4 @@ "bugs": "https://github.com/develar/read-config-file/issues", | ||
"dotenv-expand": "^5.1.0", | ||
"fs-extra": "^8.1.0", | ||
"js-yaml": "^3.13.1", | ||
"json5": "^2.1.1", | ||
"json5": "^2.1.2", | ||
"lazy-val": "^1.0.4" | ||
@@ -32,5 +31,4 @@ }, | ||
"@types/dotenv": "^8.2.0", | ||
"@types/fs-extra": "^8.1.0", | ||
"@types/js-yaml": "^3.12.2", | ||
"@types/node": "^13.7.7", | ||
"@types/js-yaml": "^3.12.3", | ||
"@types/node": "^13.9.8", | ||
"typescript": "^3.8.3" | ||
@@ -37,0 +35,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
17424
5
4
175
- Removedfs-extra@^8.1.0
- Removedfs-extra@8.1.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removeduniversalify@0.1.2(transitive)
Updatedjson5@^2.1.2