3 ms·
How is that absurd? I've written Node apps where I needed to get the user's home path, crossplatform. Instead of memorizing this: https://github.com/sindresorh
by sotojuan 11y ago
How is that absurd? I've written Node apps where I needed to get the user's home path, crossplatform. Instead of memorizing this:
https://github.com/sindresorhus/os-homedir/blob/master/index.js https://github.com/sindresorhus/os-homedir/blob/master/index...
I'd rather `npm install` it and require it. Of course, now Node has this: https://nodejs.org/api/os.html#os_os_homedir https://nodejs.org/api/os.html#os_os_homedir, but it didn't and you get the point.
The problem was with npm and allowing unpublishing/hijacking, not the Node community.
- kbenson 11y agoIt's absurd because the obvious choice from the beginning should have been a library of abstracted OS concepts. Even if it starts as a single method/function for determining the homedir, making sure it can easily handle more abstractions is the obvious choice. People wanting homedir() will likely also want a way to separate a path from a file, know how to separate path components based on platform ('/' vs '\'), and a few other obvious things (see the os module you referenced). A low barrier of entry for submitting modules is generally a good thing, but if it's too low, you end up filling your ecosystem with crap.
- rat87 11y agoPlus hopefully the functions in the module would be more consistent(with each other).
- merb 11y agoIt's absurd cause the repo contains files to handle git, npm and other stuff that have more line's written than the actual code.