Node module that provides utilities for interacting with the operating system and the hardware of the machine.
JavaScript:
const lupUtils = require('lup-utils');
// JSON parsing
console.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:
import lupUtils from 'lup-utils';
// JSON parsing
console.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 }