News for hackers. Stuff that matters.
Re:4B If Statements by divbzero on Thursday December 28, 2023 @06:12AM (#38792262)
Amazingly, following “don’t repeat yourself” in its purest form, is-even depends on is-odd:

  /*!
   * is-even <https://github.com/jonschlinkert/is-even>
   *
   * Copyright (c) 2015, 2017, Jon Schlinkert.
   * Released under the MIT License.
   */

  'use strict';
  
  var isOdd = require('is-odd');
  
  module.exports = function isEven(i) {
    return !isOdd(i);
  };
Re:4B If Statements by goalieca on Thursday December 28, 2023 @08:55AM (#38793488)
If this code runs on hundreds of millions of phones and computers, npm seems horrible for the environment! Not only because of runtime, but because we’re talking so much just to host and serve these modules!
Re:4B If Statements by fritzo on Thursday December 28, 2023 @12:19PM (#38795744)
These packages are performance art, and shall not be judged by efficiency metrics.
Re:4B If Statements by darkwater on Thursday December 28, 2023 @12:55PM (#38796215)
I bet a dollar you started writing "performance" and then rewrote it as "efficiency" :)
Re:4B If Statements by fritzo on Thursday December 28, 2023 @01:50PM (#38797025)
Good guess, but sorry :) You can pay at https://github.com/sponsors/fritzo?frequency=one-time
Re:4B If Statements by asylteltine on Thursday December 28, 2023 @12:09PM (#38795614)
That’s right. Npm and the entire node ecosystem is just terrible. Specifically because you can get a production ready package from even Google, and you know it’s going to have some random useless package in the chain somewhere.