r/node • • Aug 14 '20

npm install --save me

Post image
1.1k Upvotes

82 comments sorted by

195

u/willhtun Aug 14 '20

An intern pushing the whole node_modules to github

16

u/[deleted] Aug 14 '20

I once backup my project with all node_modules because why not

0

u/[deleted] Aug 14 '20

[deleted]

3

u/Alkyonios Aug 17 '20

Isn't package.json enough? I thought package-lock is generated every time you npm install

→ More replies (2)

1

u/SpinelessLinus Aug 14 '20

Hahhahahahha

57

u/KilianKilmister Aug 14 '20

Pro tip for keeping your packages small:

Specify the files property in you package.json. It’s an array of globs specifying what files should be included in the published package.

A few files will be included regardless:

  • package.json (duh)

  • README

  • CHANGES/CHANGELOG/HISTORY

  • LICENSE/LICENCE

  • NOTICE

  • the file specified in the main field

I’ve seen package that ended up a magnitude smaller after specifying it.

source: npm doc

107

u/[deleted] Aug 14 '20

non javascript developers waiting that amout every time they build their project so they can see what they just wrote

41

u/[deleted] Aug 14 '20

Fight fight fight....

43

u/[deleted] Aug 14 '20

I don't want to. Backend devs are very insecure since js can do backend

11

u/[deleted] Aug 14 '20

*laughs in C#*

→ More replies (1)

1

u/[deleted] Aug 14 '20

Why would that be the case at all?

→ More replies (12)

34

u/[deleted] Aug 14 '20

npm is 10,000x easier than using tools like gradle too. Even pip is frustrating to use.

→ More replies (1)

64

u/warlockdn Aug 14 '20

3gb ?? Nope doesn't happen

25

u/StoneCypher Aug 14 '20

quickly, argue that the joke isn't factual

17

u/japottsit Aug 14 '20

Just another kiddie that is trying to join in

7

u/[deleted] Aug 14 '20 edited Apr 20 '25

serious childlike lush deliver screw wakeful live towering scale vast

This post was mass deleted and anonymized with Redact

15

u/[deleted] Aug 14 '20

[removed] — view removed comment

2

u/[deleted] Aug 15 '20

Why?

→ More replies (2)

0

u/[deleted] Aug 14 '20

[deleted]

17

u/warlockdn Aug 14 '20

Well if you rely on external packages for doing everything tiny operation the packages will be insane.

14

u/Sir_Jeremiah Aug 14 '20

npm install is-odd @latest

0

u/Chicken__Nuggets666 Aug 14 '20

I cant understand if this is a joke or not. is-odd is part of the core of every project i have worked in.

6

u/Sir_Jeremiah Aug 14 '20

It’s a joke, checking if a number is odd is so trivial that installing a package for it seems ridiculous at first glance. The guy who created the package made it for practice the year he learned programming. There’s a little debate around it, as the package does do a bit more than just mod 2 on the input, this post should help to explain a bit further.

→ More replies (1)

48

u/ghillerd Aug 14 '20

Do people think single page app means an app with a single page in it?

7

u/Lhaer Aug 14 '20

But technically, that's exactly what it is.

3

u/brystephor Aug 14 '20

...no

but lets hypothetically say we did think that's what it meant, then what would you say the actual meaning of it is?

5

u/ghillerd Aug 14 '20

A web application served with a single index page and a single JavaScript bundle. Edit for clarity - JavaScript is used to handle routing and navigation, so it can still contain many distinct pages of content/functionality, but they're all in the client rather than being requested from the server one by one.

1

u/jordanbtucker Aug 14 '20

Depends on how you configure it. You can use code splitting in webpack for example. It's still an SPA, but some content will be loaded on demand.

1

u/Protean_Protein Aug 14 '20

Unless you toss in some SSR with react-snap.

4

u/ghillerd Aug 14 '20

And the wheel of Correct Web Architecture turns once more

0

u/[deleted] Aug 14 '20

[deleted]

10

u/AJohnnyTruant Aug 14 '20

Always has been..

6

u/legowerewolf Aug 14 '20

and the bundler strips out 2.98gb of that - assuming they use a bundler.

13

u/[deleted] Aug 14 '20

3gb? what kinda spa u building? goddman spaceship or something?

12

u/Dynastig Aug 14 '20

If not for npm packages, how else would you figure out if a number is even or odd? It’s impossible!

4

u/EdenExperience Aug 14 '20

The biggest npm project was 300mb. Not even near a gb. I think I had puppeteer installed to the project which is really big.

2

u/NoInkling Aug 15 '20

Puppeteer is only that big because it bundles Chromium.

1

u/EdenExperience Aug 16 '20

I would never have guessed 😅

3

u/[deleted] Aug 14 '20

to prevent this, I spend some time to look for alternative to a module that depends on too many useless shit I will not use cuz my node version already has it

5

u/ZeroSevenTen Aug 14 '20

single page app? nah, more like SPA. also --save aint a thing anymore 🙃

2

u/shacamin Aug 14 '20 edited Aug 14 '20

I use save all the time? What do you mean it isn't a thing anymore?

9

u/ZeroSevenTen Aug 14 '20 edited Aug 15 '20

it does --save automatically since NPM 5

4

u/shacamin Aug 14 '20

So it does. You'd think they would put a little message in the terminal for something like that.

4

u/ZeroSevenTen Aug 14 '20

yea, i agree. older tutorials use it so it creeps its way back to newer devs, or devs who just never got the memo

2

u/Dgameman1 Aug 14 '20

No need for it

1

u/jordanbtucker Aug 14 '20

You're wasting precious keystrokes.

1

u/steeeeeef Aug 15 '20

He put —save to make a funny title

3

u/abc-123-456 Aug 14 '20

Yarn 2 FTW

2

u/SillAndDill Aug 14 '20 edited Aug 14 '20

This should be a promo for Deno’s approach to dependencies

(yeah, hoping to be called out on this, i only read 3 blog posts about it, heh)

6

u/jordanbtucker Aug 14 '20

Demo still has to download and cache the dependency tree.

1

u/konamax123 Aug 14 '20

That would be an insane amount of modules.

1

u/Optimal_FruitCake Aug 14 '20

Get a better internet connection. JavaScript and AOL dial up internet don’t go well together.

1

u/anishkalankan Aug 14 '20

Deleting the node modules without cli.

1

u/luckyincode Aug 14 '20

Maybe they should set up CI so they can stop waiting and do something else. What is this? 1989?

1

u/hbarcelos Aug 15 '20

That's why you use yarn.

1

u/GuardianAnal Aug 15 '20

tip: use pnpm

1

u/nscore Aug 15 '20

^ u fail at #DevOps in my Day #RubyHadRails then I Coffee Scripted Ember.js at intel, for shit you wont have for 3 more years...

1

u/detectretract Aug 21 '20

hello you may think this is a joke, but it is not funny. to whoever is reading this, webpack was a FUCKING mistake. I won't go into details, but just please, trust me.

1

u/[deleted] Aug 14 '20

Just use yarn.

1

u/Dangle76 Aug 14 '20

Tbh while it’s obviously not this much data, I just started getting into front end and react, and the fact that “create-react-app” takes 5-6 minutes to complete, a big part of it being that JS doesn’t have a normal standard library, drives me insane. Doing the build during CI and the sheer amount of packages that my container needs to download for simple apps to run is mind numbing and frustrating.

2

u/steeeeeef Aug 15 '20

Yea create-react-app is no bueno. It’s bloated. Just create your own project, it’s a little bit more work but keeps things clean.

0

u/[deleted] Aug 14 '20

[deleted]

1

u/Kamek437 Aug 14 '20

For like 10 years.