tldr-node-client: tldr is showing a debug message when a page was not found
When I run tldr on a command which could not be found, I get the following output:
✔ Page not found. Updating cache...
✔ Creating index...
Error: Page not found.
If you want to contribute it, feel free to send a pull request to: https://github.com/tldr-pages/tldr
at /usr/lib/node_modules/tldr/lib/tldr.js:147:17
Does the last line have any purpose? It’s always the same and not really useful. (tldr version 3.3.7)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 20 (14 by maintainers)
It works!!! 🎉 I wrote
message(), instead ofmessage. I’ll open a PRI just copy-pasted stuff from the internet 😅
Exactly as you told:
lib/tldrerror.js:In
lib/tldr.js:In
tldrI tried importing it with and without the curly braces.
Btw, thanks for explaining all that to me, you probably would be a lot faster if you did it yourself 😅
You did that by the book 😂 https://nitter.cc/ThePracticalDev/status/705825638851149824
How about
and
?
No problem, I don’t mind in the least.
It’s more conventional (at least, it also may be required 🤷🏻) to export things after you declare them, so in
tldrerror.jsput themodule.exportsline below the class definitionSince you’re creating a whole new file for
TldrError(which is the right way to do it), and you’re probably not going to put anything else than the class in the file, you can directly export the class instead of exporting an object that contains the class, so writemodule.exports = TldrError;insteadThat should theoretically work.
I’d like to, but i hardly know any javascript.