Compare commits

..

3 Commits

Author SHA1 Message Date
453128fc4f Update time functions 2025-10-21 13:59:29 +02:00
a399225c43 Export module entrypoint 2023-11-22 21:47:24 +01:00
08fabf5bf8 Add ESM Module support 2023-10-14 16:54:53 +02:00
9 changed files with 1883 additions and 2859 deletions

4
.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated

3
.gitignore vendored
View File

@ -2,4 +2,7 @@ node_modules/
logs/
yarn.lock
out/
esm/
.history/
.yarn/cache
.yarn/install-state.gz

File diff suppressed because one or more lines are too long

874
.yarn/releases/yarn-3.6.4.cjs vendored Executable file

File diff suppressed because one or more lines are too long

11
.yarnrc.yml Normal file
View File

@ -0,0 +1,11 @@
nodeLinker: node-modules
npmScopes:
"hibas123":
npmRegistryServer: "https://git.hibas.dev/api/packages/hibas123/npm/"
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
yarnPath: .yarn/releases/yarn-3.6.4.cjs

3269
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,14 @@
{
"name": "@hibas123/nodelogging",
"version": "3.1.3",
"packageManager": "yarn@3.6.4",
"version": "4.0.1",
"description": "",
"main": "out/index.js",
"types": "out/index.d.ts",
"module": "esm/index.js",
"scripts": {
"prepublish": "npm run build",
"build": "tsc",
"build": "tsc && tsc -p tsconfig.esm.json",
"watch-ts": "tsc --watch",
"watch-js": "nodemon out/test.js",
"watch": "concurrently npm:watch-*",
@ -23,17 +25,18 @@
"files": [
"src/",
"out/",
"esm/",
"tsconfig.json",
"readme.md"
],
"devDependencies": {
"@types/node": "^15.3.0",
"concurrently": "^6.1.0",
"nodemon": "^2.0.7",
"typescript": "^4.2.4"
"@types/node": "^24.9.1",
"concurrently": "^9.2.1",
"nodemon": "^3.1.10",
"typescript": "^5.9.3"
},
"dependencies": {
"@hibas123/logging": "^3.1.2",
"@hibas123/logging": "^4.0.2",
"@hibas123/utils": "^2.2.18"
}
}

View File

@ -11,6 +11,14 @@ LoggingBase.nativeFunctions = {
return process.hrtime();
}
},
diffTime: (start, end) => {
if (process.hrtime.bigint) {
return Number((BigInt(end) - BigInt(start)) / BigInt(1000)) / 1000;
} else {
let diff = process.hrtime(start);
return diff[0] * 1000 + diff[1] / 1000000;
}
},
endTimer: (start) => {
if (process.hrtime.bigint) {
return Number((process.hrtime.bigint() - start) / BigInt(1000)) / 1000;

11
tsconfig.esm.json Normal file
View File

@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"target": "ES2017",
"moduleResolution": "node",
"outDir": "esm"
},
"exclude": ["node_modules"],
"include": ["src"]
}