Luciano Mammino 𝕏 Node.js Design Patterns Profile picture
#AWS #Serverless Hero & MVP. Senior Architect @fourTheorem, author of πŸ“• https://t.co/Vhhe4G4GCN & βœ‰οΈ https://t.co/XMK2BWythj #Nodejs, #JavaScript, #Rust πŸ¦€ & #Cloud ☁️
Sep 15, 2022 β€’ 10 tweets β€’ 6 min read
Here are 6 of my favorite third-party libraries when building CLI applications using #NodeJS

Want to know why?πŸ‘‡πŸ§΅ commander ➑️ npm.im/commander

Simple yet powerful command-line argument parser. It automatically generates help messages and can be configured to support multiple commands.

I ❀️ it bc it's not prescriptive, you can organize the code as you want (1 file or more).
Aug 3, 2022 β€’ 40 tweets β€’ 73 min read
"Yo, why are #JavaScript and its ecosystem so messy?!" 😑

Well, I am glad you asked... Let me tell you a story! πŸ€“

πŸ§΅πŸ‘‡ For starting... #JavaScript was not designed to be the language that it is today!

JS was created in 1995 by @BrendanEich for Netscape, a web browser that was trying to come up with a language to make the web more interactive
May 25, 2021 β€’ 23 tweets β€’ 8 min read
I have been confused for a while on what's the best way to implement a "to string" functionality for a #Rust struct. πŸ¦€

The reason why this has been confusing to me is that there are indeed many ways to do that and they all have different purposes!

This is what I learned

πŸ‘‡πŸ§΅ The first thing that you can do is to just implement a simple `to_string()` function directly on your struct!

play.rust-lang.org/?version=stabl…
Oct 1, 2020 β€’ 13 tweets β€’ 3 min read
Do you know what's in a #JWT token?

Here's a quick thread to learn something about this! πŸ‘‡ A JWT token (JSON Web Token) is just a string with a well-defined format. A sample token might look like this:

```
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJoZWxsbyI6ImZyb20gSldUIn0.XoByFQCJvii_iOTO4xlz23zXmb4yuzC3gqrWNt3EHrg
```
Sep 17, 2020 β€’ 8 tweets β€’ 3 min read
@eleven_ty micro tip: Give eleventy some credit by injecting a "generator" meta tag in your HTML! πŸ”₯

Frontpage and Dreamweaver used to get credit this way, why shouldn't we give Eleventy some credit too? πŸ˜‡

(a short thread in 3 steps πŸ‘‡) Image STEP 1. Create a data file in `_data/site.js` with the following content: Image
Aug 18, 2020 β€’ 7 tweets β€’ 2 min read
✨ Rob Pike's 5 Rules of #programming ✨

#golang #simplicity

πŸ§΅πŸ‘‡ 1️⃣ You can't tell where a program is going to spend its time. Bottlenecks occur in surprising places, so don't try to second guess and put in a speed hack until you've proven that's where the bottleneck is.
Aug 11, 2020 β€’ 6 tweets β€’ 2 min read
Software engineering #anxiety, let's talk about it. Specifically, let me try to deconstruct my personal anxiety

πŸ§΅πŸ‘‡ 1️⃣ classic impostor syndrome: it doesn't matter how good I actually am with some technology/tool/technique. Even if I can get the job done, it still feels far from adequate and I feel like I have to rush to get better to defend my job title & credibility...
Aug 4, 2020 β€’ 16 tweets β€’ 7 min read
I spoke about how #JavaScript module bundlers (those things like #Webpack) work under the hood yesterday at @coderful!

πŸ—’Here's a short-ish summary:

1/
TLDR: Module bundlers like Webpack are not "complicated" or "magic" per se, the practice of module bundling is a complicated matter and you need to understand it before you can fully understand what a module bundler does and how to configure it correctly! πŸ¦„

2/
Jul 29, 2020 β€’ 9 tweets β€’ 3 min read
I love to use @StandardJS to enforce consistent code style in all my #JavaScript / #NodeJS projects. You can easily do that with:

```
npx standard
```

But I prefer to setup @geteslint for more extensibility.

🧡 Here's how I do it... πŸ‘‡ 1. Initialize a new project with:

```
mkdir new-project
cd new-project
npm init -y
```
Jul 28, 2020 β€’ 4 tweets β€’ 2 min read
Great #JavaScript array cheatsheet!

One thing that deserves a bit more info is that `.sort()`.

Check out below this tweet for more info if curious! By default `.sort()` will sort the array items lexicographically (string sorting). Image
Jul 28, 2020 β€’ 11 tweets β€’ 4 min read
βš›οΈ Create #React App (CRA) it's a wonderful tool, but IMHO it tries to do too much and tends to give you a bloated setup.

If you are like me and prefer to start simple and build incrementally, here's a React scaffold alternative in just 10 simple-ish steps!

🧡 A thread πŸ‘‡ 1. πŸ₯³ Create and init your project

mkdir my-new-react-project && cd my-new-react-project && npm init -y
Jun 30, 2020 β€’ 7 tweets β€’ 6 min read
What have you learned by using/studying different programming languages?

Here's my personal 🧡thread🧡, but I look forward to seeing your version of this :)

#learning #coding #PHP: sandboxing the lifecycle and data related to every request is often a good idea.

(@official_php)
Jun 25, 2020 β€’ 4 tweets β€’ 4 min read
@nim_lang just did a quick (& stupidly simple) benchmark comparing asyncHttpServer with a plain @nodejs http server. The #Nodejs server seems ~3.5x faster than the #nim one... I did expect opposite results! Am I doing something stupid or is this expected? ImageImageImage After setting up the @nim_lang "-d:release" flag and changing the @nodejs implementation to use the cluster module, these are some new results. ImageImage