[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#841196: ITP: node-os-homedir -- Node.js 4 `os.homedir()` ponyfill



 ❦ 18 octobre 2016 17:57 +0300, Lars Wirzenius <liw@liw.fi> :

>> The code, well...
>> 
>> 	if (process.platform === 'linux') {
>> 		return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null));
>> 	}
>> 
>> Things are more complicated than that. What exactly is this code meant
>> to be used for?
>
> This is so wrong, I would like to ask that this package not be allowed
> into Debian until it's fixed.

This has already been reported:
 https://github.com/sindresorhus/os-homedir/issues/4

You can find other implementations that are also doing fishy stuff:
 https://github.com/wilmoore/node-homedir/blob/master/index.js

Author is usually hostile to get things right because it "works in 99%
of cases" (https://github.com/chalk/supports-color/pull/35).

At some point, the community will provide a decent standard lib instead
of the myriad of bad written modules. The leftpad issue helped a bit for
this. We have to bear with the low quality of those modules for now. If
we have to fix all the JS ecosystem ourselves, nothing will be done. And
we have seen in the past that is is pointless to alienate a community
(remember how violent the confrontation with the Ruby community was, 5
years ago).
-- 
Keep it right when you make it faster.
            - The Elements of Programming Style (Kernighan & Plauger)

Attachment: signature.asc
Description: PGP signature


Reply to: