The Node require method that loads source files, compiles and caches them is ok, but could be
made a lot more powerful. Luckily one can replace the built-in require in user space without
much effort. In this presentation I will show how to
use your own require version with extra features, like cache busting and passing extra variables
or loaded code transformation.
speed up application startup by 25% with a single require include to avoid path hunting.
details
I will base the presentation explaining the module loading logic and
the javascript tricks (like faking lexical scope) that allowed me to implement the following
interesting projects:
really-need is a powerful require replacement module.
Gleb Bahmutov is JavaScript ninja, image processing expert and software quality fanatic.
After receiving a PhD in computer science from Purdue University,
Gleb worked on laser scanners, 3D reconstruction, and panorama-based virtual tours at EveryScape.
Later Gleb switched to writing browser data visualization software at MathWorks.
After a year, Gleb went back to the startup environment and developed software quality
analysis tools at uTest (now Applause).
Today Gleb is developing real-time financial analysis tools at Kensho.
He blogs about software development topics at http://glebbahmutov.com/blog/
and links his projects at http://glebbahmutov.com/.
You can follow him and his work @bahmutov
abstract
The Node
require
method that loads source files, compiles and caches them is ok, but could be made a lot more powerful. Luckily one can replace the built-inrequire
in user space without much effort. In this presentation I will show how torequire
version with extra features, like cache busting and passing extra variables or loaded code transformation.details
I will base the presentation explaining the module loading logic and the javascript tricks (like faking lexical scope) that allowed me to implement the following interesting projects:
require
replacement module.speaker bio
Gleb Bahmutov is JavaScript ninja, image processing expert and software quality fanatic. After receiving a PhD in computer science from Purdue University, Gleb worked on laser scanners, 3D reconstruction, and panorama-based virtual tours at EveryScape. Later Gleb switched to writing browser data visualization software at MathWorks. After a year, Gleb went back to the startup environment and developed software quality analysis tools at uTest (now Applause). Today Gleb is developing real-time financial analysis tools at Kensho. He blogs about software development topics at http://glebbahmutov.com/blog/ and links his projects at http://glebbahmutov.com/. You can follow him and his work @bahmutov