markuplint
Version:
An HTML linter for all markup developers
12 lines (11 loc) • 540 B
TypeScript
/**
* Loads a JSON module by its path using `require`, returning `null` if the module cannot be found.
*
* This is a safe wrapper around `require` that swallows resolution errors,
* making it suitable for optional module loading (e.g., locale files).
*
* @template T - The expected shape of the JSON module.
* @param modulePath - The module specifier or file path to load.
* @returns The parsed JSON module, or `null` if it could not be loaded.
*/
export declare function getJsonModule<T extends {}>(modulePath: string): T | null;