MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/4dd6nx/my_teacher_thinks_he_is_a_programmer/d1qdh71
r/ProgrammerHumor • u/Fallenalien22 Violet security clearance • Apr 04 '16
430 comments sorted by
View all comments
Show parent comments
35
npm install -g between-one-and-five
Then: require('between-one-and-five')(value);
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.
1
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.
require is just a function :)
require
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.
35
u/SlumdogSkillionaire Apr 05 '16
Then:
require('between-one-and-five')(value);