Socket
Socket
Sign inDemoInstall

fd-package-json

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fd-package-json - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

12

dist/commonjs/main.js
"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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc