🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

load-json-file

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-json-file - npm Package Compare versions

Comparing version

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",