NodeJS Best Practices for Production in 2019

Attached: 1200px-Node.js_logo.svg.png (1200x734, 52K)

Other urls found in this thread:

medium.com/@monothorn/nodejs-best-practices-for-production-5b173983d14b
twitter.com/SFWRedditVideos

how do you inject a dependency in the form of a node package

ATM I'm considering making an injector factory file that exports a bunch of constructors and just make it a habit to call Injector.(whatever)() to get an object.

The best practice for node.js is not using it

based trips

Webpack

tpbp

how does webpack help?

Digits and truthpilled
Use assemvly baka

based

If you are looking for additional tips for NodeJS Best Practices for production in 2019 , follow the link

medium.com/@monothorn/nodejs-best-practices-for-production-5b173983d14b

Why?

this

Don't forget to always commit node_modules among your code changes to ensure that your coworkers also have the same, sane working environment!

kek

It's shit. Rails is better, for example.

Hackr.io

"no"

Java us better

Trips of truth

Attached: 114.png (293x335, 94K)

not him, but webpack and other bundler (e.g. rollup) can be used in conjunction with e.g. babel to transpile and polyfill to a different ecmascript spec (if you're deploying to browser or older node version, e.g. lts 6 or 8) and you can also put minifiers and uglifiers at the end of the bundler chain to get smaller js files.

>Implying that isn't the only way to get a reproducible build.
Javashit development is such a fucking meme.

Why are you lying?
"package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates."
same with Yarn
"The yarn.lock file is utilized as follows:
- If yarn.lock is present and is enough to satisfy all the dependencies listed in package.json, the exact versions recorded in yarn.lock are installed, and yarn.lock will be unchanged. Yarn will not check for newer versions.
- If yarn.lock is absent, or is not enough to satisfy all the dependencies listed in package.json (for example, if you manually add a dependency to package.json), Yarn looks for the newest versions available that satisfy the constraints in package.json. The results are written to yarn.lock."

>using js on your back-end
yikes

>Two package managers
>Two lock files
>"We didn't like the problems we had from trying to use JavaScript to write durable system code, so we did it again"
Overcomplicated bullshit that breaks. Don't get me wrong: Checking node modules in is the wrong approach, but the right approach is just not using JavaScript unless absolutely necessary. Few other mainstream languages have package and build environments that are nearly this infuriatingly rube-goldbergesque. I cannot tell you the number of times I've checked out a project to find the packages.json is a disaster and webpack is broken. Literally git pull, then fail to build. If it does build, there are version mismatches you don't find until runtime when shit doesn't work because some asshole made a breaking change on a minor version increase, and figuring out what even changed is a nightmare.

JavaScript is an antipattern. I swear it corrupts developers into doing absolutely shit work.

If a project uses npm use npm install if a project uses yarn use yarn install, wtf are you retarded?

the loo

Don't act like a retard. I was clearly saying that npm was so garbage and unusable an entirely separate package manager had to be made, and they still fucked it up pretty badly. And the number of projects that have both lock files present (and they don't agreed) is significant.
Dumpster. Fire. Coming from languages with sane package managers and build tools makes JavaScript absolutely infuriating because these are solved problems.

it is mainly soiboys and homosexuals who use node.js, not pajeets.