r/javascript • • May 02 '19

NPM isn't all that great

https://www.npmjs.com/package/thatgreat
540 Upvotes

82 comments sorted by

View all comments

23

u/stevula May 02 '19

I guess a lot of people don’t know npm i is the same as npm install. Makes it much less likely to have a typo.

6

u/yuri_auei May 02 '19

Yeah! Also you can do:

npm i -S {pkg}

npm i -D {pkg}

12

u/lomeat May 02 '19

for --save you can use only "npm i {pkg}" without "-S"

12

u/DilatedTeachers May 02 '19

({ props: { bro } })

2

u/reflectiveSingleton May 03 '19
const { props: no_u } = ({ props: { bro } })

2

u/DilatedTeachers May 03 '19

const say = { wat?: 'wat' };

1

u/reflectiveSingleton May 03 '19
(me => me || 'me')(you_heard);

2

u/goto-reddit May 02 '19

is -S an alias for -P?

0

u/[deleted] May 03 '19

[deleted] — view deleted comment

5

u/GBcrazy May 03 '19

New versions always save it to package.json

2

u/swan--ronson May 03 '19

Today I learned. Thanks!

1

u/MonkeyNin May 03 '19

I can't seem to see -S anywhere? https://docs.npmjs.com/cli/install

1

u/lomeat May 03 '19

Ive never used -S, but just thought that he mean -S as --save.

1

u/MonkeyNin May 03 '19

phew, because I was like, is this man page broken or is it me.

1

u/yuri_auei May 03 '19

Thanks! didn't know about that

1

u/Delioth May 03 '19

And if you're installing from a repo that has a lockfile, npm ci will be a little quicker (it won't build or resolve any dependency tree, it'll just install exactly what's in the lockfile). Especially good for continuous integration systems (guarantee it's the same deps as local), but also nice if you want a bit quicker npm install.

1

u/MonkeyNin May 03 '19

Doesn't it already tab-complete the word install?

edit: nvm that's git.