Socket
Socket
Sign inDemoInstall

load-json-file

Package Overview
Dependencies
7
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.1.0 to 5.2.0

27

index.d.ts

@@ -1,2 +0,2 @@

export type Reviver = (key: string, value: any) => any;
export type Reviver = (this: unknown, key: string, value: unknown) => unknown;
export type BeforeParse = (data: string) => string;

@@ -8,3 +8,4 @@

*/
beforeParse?: BeforeParse;
readonly beforeParse?: BeforeParse;
/**

@@ -14,3 +15,3 @@ * Prescribes how the value originally produced by parsing is transformed, before being returned.

*/
reviver?: Reviver;
readonly reviver?: Reviver;
}

@@ -25,8 +26,10 @@

*
* import * as loadJsonFile from 'load-json-file';
* import loadJsonFile from 'load-json-file';
*
* const json = loadJsonFile.sync('foo.json');
* //=> {foo: true}
* (async () => {
* const json = await loadJsonFile('foo.json');
* //=> {foo: true}
* })();
*/
export function sync<T = unknown>(filePath: string, options?: Options): T;
export default function loadJsonFile<T = unknown>(filePath: string, options?: Options): Promise<T>;

@@ -40,9 +43,7 @@ /**

*
* import loadJsonFile from 'load-json-file';
* import * as loadJsonFile from 'load-json-file';
*
* (async () => {
* const json = await loadJsonFile('foo.json');
* //=> {foo: true}
* })();
* const json = loadJsonFile.sync('foo.json');
* //=> {foo: true}
*/
export default function loadJsonFile<T = unknown>(filePath: string, options?: Options): Promise<T>;
export function sync<T = unknown>(filePath: string, options?: Options): T;
{
"name": "load-json-file",
"version": "5.1.0",
"version": "5.2.0",
"description": "Read and parse a JSON file",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc