News for hackers. Stuff that matters.
Re:NPM – "is-even", 160k weekly downloads by jeroenhd on Tuesday November 16, 2021 @11:24AM (#29242396)
Ha, I remember this package. It's a dependency of a dependency of a dependency in several projects inside the company I work for. I think either React, Babel, or Webpack depended on it at some point in time.

Nobody needs to write satire about the state of Javascript package management when people write (and use!) libraries like these.

Re:NPM – "is-even", 160k weekly downloads by smt88 on Tuesday November 16, 2021 @11:35AM (#29242547)
This package certainly seems like satire. It has no actual implementation in it. Instead it depends on another npm package: `is-odd`.

https://github.com/i-voted-for-trump/is-even/blob/master/pac...

Re:NPM – "is-even", 160k weekly downloads by ratww on Tuesday November 16, 2021 @12:01PM (#29242999)
`is-odd` is made by the same developer. This was created to inflate NPM numbers.
Re:NPM – "is-even", 160k weekly downloads by 3pt14159 on Tuesday November 16, 2021 @01:42PM (#29244686)
This is what I like about ruby. I search, I find, they have almost no downloads:

https://rubygems.org/gems/is_odd/versions/0.1.1

https://rubygems.org/gems/is_even/versions/0.1.0

Re:NPM – "is-even", 160k weekly downloads by rezonant on Tuesday November 16, 2021 @10:05PM (#29248923)
It is built into Ruby.

    2.7.3 :003 > 1.odd?
     => true
    2.7.3 :004 > 2.odd?
     => false
    2.7.3 :005 > 1.even?
     => false
    2.7.3 :006 > 2.even?
     => true
    2.7.3 :007 >
Re:NPM – "is-even", 160k weekly downloads by 3pt14159 on Wednesday November 17, 2021 @06:58AM (#29251902)
That's amazing. Do you know since when? I've been doing Python development for a while.
Re:NPM – "is-even", 160k weekly downloads by rezonant on Wednesday November 17, 2021 @09:15PM (#29261335)
At least since 1.8.7 (released May 31, 2008)

EDIT: Confirmed, it was added in 1.8.7 according to Ruby Docs [1] [2]

[1] https://ruby-doc.org/core-1.8.7/Integer.html (present)

[2] https://ruby-doc.org/core-1.8.6/Integer.html (not present)

Re:NPM – "is-even", 160k weekly downloads by cormacrelf on Tuesday November 16, 2021 @12:08PM (#29243113)
The “Usage” section in the readme doesn’t even give you any information about how it behaves on inputs that aren’t numbers. I hope the is-odd package has some way of detecting whether the input is a number or not. Maybe other packages need this too!

    isEven(0);
    //=> true
    isEven('1');
    //=> false
    isEven(2);
    //=> true
    isEven('3');
    //=> false
Re:NPM – "is-even", 160k weekly downloads by slmjkdbtl on Tuesday November 16, 2021 @01:15PM (#29244263)
You use the is-number package to check if something is a number. JavaScript packages do one thing and do it well.
Re:NPM – "is-even", 160k weekly downloads by Farow on Tuesday November 16, 2021 @12:40PM (#29243605)
It throws an error on empty or non-integer values: https://github.com/i-voted-for-trump/is-even/blob/master/tes...
Re:NPM – "is-even", 160k weekly downloads by madacol on Tuesday November 16, 2021 @04:58PM (#29246850)
He probably moved that repo away from his profile (https://github.com/jonschlinkert) to avoid being trolled
Re:NPM – "is-even", 160k weekly downloads by pram on Tuesday November 16, 2021 @12:13PM (#29243198)
Hilarious GH name, and apparently masterful troll.
Re:NPM – "is-even", 160k weekly downloads by Akronymus on Tuesday November 16, 2021 @12:21PM (#29243316)
Seems to me that the name is satire. As in, the author didn't actually vote for trump but wants to make it look like people that voted for him are creating packages like that.

I don't think such packages should be on NPM either way.

Re:NPM – "is-even", 160k weekly downloads by kej on Tuesday November 16, 2021 @12:54PM (#29243835)
His twitter feed is full of right wing talking points and he broke a 19 year voting hiatus to vote in the 2020 general election, so I don't think it's that unreasonable to think he did, in fact, vote for Trump.
Re:NPM – "is-even", 160k weekly downloads by capableweb on Tuesday November 16, 2021 @01:32PM (#29244545)
This is the user: https://github.com/i-voted-for-trump

This is what it says there:

> This is a joke. You'll only see this org if you are attempting to troll me about repositories I created when I was learning to program.

Re:NPM – "is-even", 160k weekly downloads by JasonCannon on Tuesday November 16, 2021 @02:13PM (#29245081)
This is his twitter

https://mobile.twitter.com/jonschlinkert

He definitely voted for trump.

Re:NPM – "is-even", 160k weekly downloads by op00to on Tuesday November 16, 2021 @12:27PM (#29243410)
The author is an antivaxer and based on that it is a fair shake that he voted for Trump.
Re:NPM – "is-even", 160k weekly downloads by moojd on Tuesday November 16, 2021 @12:01PM (#29243020)
I wish some of these large projects would start seriously auditing their dependencies and stop pulling in dependencies that have many dependencies themselves. There is a one-two punch of a culture of "there's a package for that" and npm not requiring flat dependency trees by default. The denial in the node community that npm is uniquely bad is frustrating. I want the community to stop denying and own these issues so things can get better. It's going to take the authors of large packages to start evangelizing the use of fewer, higher quality packages, using flat dependency trees, and re-implementing trivial functions instead of adding another node to trust.
Re:NPM – "is-even", 160k weekly downloads by ratww on Tuesday November 16, 2021 @12:26PM (#29243393)
It is an uphill battle, lemme tell you.

There is a bit of a culture clash inside Javascript. Even when you're a veteran contributor, sometimes maintainers resist changing packages, as simple as they are, because there is an implicit assumption that popular packages, or even packages with too many dependencies are "better" or "handled all the edge cases".

Even with careful evaluation of the options and a write-down of issues and a proper comparison, you need ten times as much energy to remove a package than it took to add it.

It's even worse is when "too many packages" is in the DNA of the package you're collaborating.

Re:NPM – "is-even", 160k weekly downloads by phist_mcgee on Tuesday November 16, 2021 @01:58PM (#29244872)
Don't forget too that npm by default allows minor version upgrades with the ^ prefix for version numbers, which means that unless you properly lock your dependencies, you can reintroduce changes over time, just by running npm install.
Re:NPM – "is-even", 160k weekly downloads by sulam on Tuesday November 16, 2021 @11:33AM (#29242524)
The writing, okay, fine, dude was having some fun. Actually depending on it? Sigh.