Node module that provides utilities for interacting with the operating system and the hardware of the machine.
JavaScript:
constlupUtils=require('lup-utils');// JSON parsingconsole.log(lupUtils.parseJson(`{ "key1": "value1", /* some comments */ "key2": "2025-08-11", # a date and a trailing comma}`,0,{allowComments: true,allowTrailingComma: true,interpretStringAsDate: true,returnUnquotedString: true}));TypeScript:
importlupUtilsfrom'lup-utils';// JSON parsingconsole.log('JSON:',lupUtils.parseJson(`{ "key1": "value1", /* some comments */ "key2": "2025-08-11", # a date and a trailing comma}`,0,{allowComments: true,allowTrailingComma: true,interpretStringAsDate: true,returnUnquotedString: true}));Output:
JSON: { key1: 'value1', key2: 2025-08-11T00:00:00.000Z }