Skip to content

LupCode/node-lup-utils

Repository files navigation

GitHub package.json version npm bundle size GitHub Workflow Status NPM

lup-utils

Node module that provides utilities for interacting with the operating system and the hardware of the machine.

Example

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 }

About

NodeJS library providing utility functions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published