Is client side JavaScript capable of replicating the Node.JS module loading system?
Posted
by
jt0dd
on Programmers
See other posts from Programmers
or by jt0dd
Published on 2014-08-08T23:00:40Z
Indexed on
2014/08/22
22:33 UTC
Read the original article
Hit count: 239
JavaScript
|node.js
I like the Node.JS style of JavaScript, where I can write all of my functionalities into smaller files and then require those neatly from within my code. I'm even thinking about trying to write a framework to mimic that behavior in client-side JS.
My goal would be to implement the module loading system
as accurately as possible - See Module docs.
For require()
, I can use things detailed in answers to this question, most notably JQuery's $.getScript()
. It seems to me that other aspects of the module loading system should be possible as well.
So I'm asking more experienced programmers here first, before I waist my time: Is there something that I'm missing that's going to cause such an attempt to fail miserably, or can this be successfully done?
© Programmers or respective owner