Echo JS 0.11.0

<~>

tracker1 comments

tracker1 899 days ago. link 1 point
I'm just curious why this was so liked vs other pages/sites?  It seems a little sus.
tracker1 902 days ago. link 1 point
My bad for double checking forEach and not entries... working from years old memory isn't always the greatest.  Like recalling IE5.0.0 and IE8 specific bugs (so glad I don't need to remember, but kind of sad as I've built up so much esoteric knowledge).
tracker1 902 days ago. link 2 points
Okay, so I'm able to bring in an npm module that makes pretty heavy use of npm's tcp interfaces, which is nice to see... will probably try mssql next, if that works, I'll be very happy indeed.
tracker1 904 days ago. link 2 points
This is about iterating an object... should probably also mention that if you're expecting an array, that may be null/undefined, you can use optional chaining.

    myArray?.forEach(...)

As mentioned in the article, you have Object.entries.  Should probably also mention Object.keys and Object.values.

IIRC Array.prototype.forEach was ES5 (not 6), while Object.entries was added with ES6/ES2017.
tracker1 905 days ago. link 1 point
Woot!  NPM at least seems to be able to import a module I couldn't before... will try it later.
tracker1 905 days ago. link 2 points
Validating emails with regex should have a couple guard rails...

First, you should check for length, if it's too long, then you can get some performance issues in practice.

Second, you should actually look at what valid emails can be... you can use a quoted User portion, but that may not match what you want to allow.  The Email address spec is actually more broad than what general SMTP email allows to be delivered for internet email.  YMMV of course.

Beyond this, will generally want to add secondary checks for domain portions/lookup as well.

Disclosure, I did used to work for a company that assigned profile values based on email address as an optionally single verification param (social media association, domain popularity, registration time, etc) to flag potential scam entries for additional scrutiny etc.
tracker1 906 days ago. link 1 point
Why would you publish a ruby script to npm?!?  There's no guarantee that someone with npm/node (especially in windows) has ruby installed or configured, or is running an environment that can even use a shell script.

Beyond this, node/npm has a concept of "binary" modules to add the command when you do a global/local install.  This is just so wrong in so many ways.

https://guides.rubygems.org/publishing/
tracker1 914 days ago. link 2 points
I'm not sure what advice to give here... I spent the past year dealing with very similar friction in my job, and am about to start a new one.

In the end, part of this is about education... refer the people in question to articles surrounding how these things work.
tracker1 916 days ago. link 3 points
I've added this github project to the site block list... it won't be posted again.
[more]