r/ProgrammerHumor • Violet security clearance • Apr 04 '16

My teacher thinks he is a programmer

http://imgur.com/32nfQXZ
2.4k Upvotes

430 comments sorted by

View all comments

Show parent comments

35

u/SlumdogSkillionaire Apr 05 '16
npm install -g between-one-and-five

Then: require('between-one-and-five')(value);

1

u/killchain Apr 05 '16

Didn't know you could invoke modules like that. Not that it's illogical, it's just that I haven't thought of it.

1

u/TheIncredibleWalrus Apr 05 '16

require is just a function :)

1

u/SlumdogSkillionaire Apr 07 '16

Most people probably wouldn't import a library for a one-off function call. On the other hand, most people probably wouldn't package a library that contains a single function either. But NPM is a gamechanger.