fd-package-json
Advanced tools
Comparing version 1.0.0 to 1.1.0
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -10,3 +7,2 @@ exports.findPackage = exports.findPackagePath = void 0; | ||
const promises_1 = require("node:fs/promises"); | ||
const read_package_json_fast_1 = __importDefault(require("read-package-json-fast")); | ||
/** | ||
@@ -54,4 +50,10 @@ * Determines if a file exists or not | ||
} | ||
return (0, read_package_json_fast_1.default)(packagePath); | ||
try { | ||
const source = await (0, promises_1.readFile)(packagePath, { encoding: 'utf8' }); | ||
return JSON.parse(source); | ||
} | ||
catch (_err) { | ||
return null; | ||
} | ||
} | ||
exports.findPackage = findPackage; |
import { walkUp } from 'walk-up-path'; | ||
import { resolve } from 'node:path'; | ||
import { stat } from 'node:fs/promises'; | ||
import rpj from 'read-package-json-fast'; | ||
import { stat, readFile } from 'node:fs/promises'; | ||
/** | ||
@@ -46,3 +45,9 @@ * Determines if a file exists or not | ||
} | ||
return rpj(packagePath); | ||
try { | ||
const source = await readFile(packagePath, { encoding: 'utf8' }); | ||
return JSON.parse(source); | ||
} | ||
catch (_err) { | ||
return null; | ||
} | ||
} |
{ | ||
"name": "fd-package-json", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Utilities for finding the closest package.json file", | ||
@@ -17,3 +17,3 @@ "files": [ | ||
"lint": "npm run lint:format && eslint src", | ||
"test": "c8 --reporter=lcov node --test", | ||
"test": "c8 node --test lib/**/*_test.js", | ||
"prepare": "tshy" | ||
@@ -79,5 +79,4 @@ }, | ||
"dependencies": { | ||
"read-package-json-fast": "^3.0.2", | ||
"walk-up-path": "^3.0.1" | ||
} | ||
} |
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
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
1
139
8361
- Removedread-package-json-fast@^3.0.2
- Removedjson-parse-even-better-errors@3.0.2(transitive)
- Removednpm-normalize-package-bin@3.0.1(transitive)
- Removedread-package-json-fast@3.0.2(transitive)