Skip to content

Commit a636cc0

Browse files
committed
Initial commit
1 parent cf3e8d0 commit a636cc0

File tree

16 files changed

+5825
-0
lines changed

16 files changed

+5825
-0
lines changed

.github/workflows/on-push.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: On Push
2+
on: [push]
3+
jobs:
4+
build:
5+
name: Build & Test
6+
runs-on: Linux
7+
steps:
8+
- name: Checking out repository
9+
uses: actions/checkout@v4
10+
- name: "Setup Node"
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: '22'
14+
cache: 'npm'
15+
- name: Installing
16+
run: npm install
17+
- name: Building
18+
run: npm run build
19+
- name: Linting
20+
run: npm run lint
21+
- name: Testing
22+
run: npm run test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
lib/
3+
coverage/

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 120,
3+
"trailingComma": "all",
4+
"singleQuote": true
5+
}

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
![GitHub package.json version](https://img.shields.io/github/package-json/v/LupCode/node-lup-utils)
2+
![npm bundle size](https://img.shields.io/bundlephobia/min/lup-utils)
3+
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/LupCode/node-lup-utils/on-push.yml?branch=main)
4+
![NPM](https://img.shields.io/npm/l/lup-utils)
5+
6+
# lup-utils
7+
Node module that provides utilities for interacting with the operating system and the hardware of the machine.
8+
9+
## Example
10+
11+
JavaScript:
12+
```javascript
13+
const lupUtils = require('lup-utils');
14+
15+
// JSON parsing
16+
console.log(lupUtils.parseJson(`
17+
{
18+
"key1": "value1", /* some comments */
19+
"key2": "2025-08-11", # a date and a trailing comma
20+
}
21+
`, 0, {
22+
allowComments: true,
23+
allowTrailingComma: true,
24+
interpretStringAsDate: true,
25+
returnUnquotedString: true
26+
}));
27+
28+
```
29+
30+
TypeScript:
31+
```typescript
32+
import lupUtils from 'lup-utils';
33+
34+
// JSON parsing
35+
console.log('JSON:', lupUtils.parseJson(`
36+
{
37+
"key1": "value1", /* some comments */
38+
"key2": "2025-08-11", # a date and a trailing comma
39+
}
40+
`, 0, {
41+
allowComments: true,
42+
allowTrailingComma: true,
43+
interpretStringAsDate: true,
44+
returnUnquotedString: true
45+
}));
46+
```
47+
48+
Output:
49+
```
50+
JSON: { key1: 'value1', key2: 2025-08-11T00:00:00.000Z }
51+
```

jestconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"transform": {
3+
"^.+\\.(t|j)sx?$": "ts-jest"
4+
},
5+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
6+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
7+
"collectCoverage":true
8+
}

0 commit comments

Comments
 (0)