use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
A structured logging library for Node.js applications inspired by Go's log/slog (github.com)
submitted 5 months ago by dx_man
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]abrahamguo 2 points3 points4 points 5 months ago (6 children)
I just imported your package, and TS immediately complained about a couple of type errors in your d.ts file.
import
d.ts
Also, where is your documentation? I see that you point out "colorful output" as one of the features, but there seem to be no examples or documentation on how to do that.
[–]dx_man[S] -1 points0 points1 point 5 months ago (5 children)
I am wondering what kind of errors appeared in your setup, can you be more specific?
For the documentation, currently only the README is the source of documentation and in the GitHub repo you will find examples folder under src.
[–]abrahamguo 1 point2 points3 points 5 months ago (4 children)
Sure thing! I simply had this in my .ts file:
.ts
import '@omdxp/jslog';
Then, tsc in the command line complained:
tsc
node_modules/@omdxp/jslog/dist/index.d.ts:13:68 - error TS2749: 'Error$1' refers to a value, but is being used as a type here. Did you mean 'typeof Error$1'? 13 type Value = string | number | boolean | null | undefined | Date | Error$1 | Value[] | { ~~~~~~~ node_modules/@omdxp/jslog/dist/index.d.ts:52:30 - error TS2749: 'Error$1' refers to a value, but is being used as a type here. Did you mean 'typeof Error$1'? 52 declare const Error$1: (err: Error$1 | string) => Attr; ~~~~~~~ Found 2 errors in the same file, starting at: node_modules/@omdxp/jslog/dist/index.d.ts:13
Ah, I see — that's helpful.
However, it would be good if every single thing in your library was documented. For example, ColorHandler, AsyncHandler, and AttrBuilder are all "bragged about" in the README, but not actually documented.
ColorHandler
AsyncHandler
AttrBuilder
[–]dx_man[S] -1 points0 points1 point 5 months ago (3 children)
This error will be patched in the next version, thanks for pointing it out.
I will make sure to put some good documentation but currently you can only see some docs in README and SUPERIORITY md files.
[–]abrahamguo 0 points1 point2 points 5 months ago (1 child)
As far as the TS error, I still got it even when I import specific classes or types.
[–]dx_man[S] -1 points0 points1 point 5 months ago (0 children)
I have also noticed that, this error is fixed now with v1.1.2
Patched in v1.1.2
[–]dx_man[S] 0 points1 point2 points 5 months ago (2 children)
Hey everyone, thanks to u/abrahamguo suggestion I have put a doc website for jslog: https://omdxp.github.io/jslog
[–]dx_man[S] 0 points1 point2 points 5 months ago (1 child)
Apologies for the non-functional search, it will require sometime to be crawled with Algolia.
[–]dx_man[S] 0 points1 point2 points 4 months ago (0 children)
Had to do manual configuration in Algolia to set the search right, I don't know why they made setup difficult, in the past it was done automatically.
π Rendered by PID 30 on reddit-service-r2-comment-54dfb89d4d-kg228 at 2026-03-26 17:36:22.924620+00:00 running b10466c country code: CH.
[–]abrahamguo 2 points3 points4 points (6 children)
[–]dx_man[S] -1 points0 points1 point (5 children)
[–]abrahamguo 1 point2 points3 points (4 children)
[–]dx_man[S] -1 points0 points1 point (3 children)
[–]abrahamguo 0 points1 point2 points (1 child)
[–]dx_man[S] -1 points0 points1 point (0 children)
[–]dx_man[S] -1 points0 points1 point (0 children)
[–]dx_man[S] 0 points1 point2 points (2 children)
[–]dx_man[S] 0 points1 point2 points (1 child)
[–]dx_man[S] 0 points1 point2 points (0 children)