3 ms·
Do you keep your own javascript "standard lib"?
And if so, what is in it?
What I mean is a .js file full of functions that you commonly use, and include in every project. Right now, I'm building myself one, and so far have stuff like:
A basic function for loading an external JSON.
A function called "modal", pops a jquery superbox.
A function called "chomp", which removes trailing newline characters from a string.
What I'd really love, however, is to also be able to include an "init" function that:
A) Loads necessary "helper" js, like jquery, jquery-ui
B) Loads necessary "helper" css, like css for jquery-superbox
- dhaivatpandya 15y agoUnderscore.js is my standard lib.
- zoowar 15y agoUnderscore makes me wonder if people really understand JS.
- c_t_montgomery 15y agoWhat do you mean by this? Typical _.js users don't really understand javascript? I ask because I feel like _.js is a fantastic library that I've been using in almost every project of mine since first trying it out. I've really grown to like it, but am interested in what you mean by your comment.
- kls 15y agoI don't know the grandparents reasoning for the statement but if I where to assume, it would be that many of the popular implementations support much of the functionality natively. If which it may be that the grandparent is not considering the case that many use underscore as a polyfill to support such functionality on a broader array of clients that may or may not support the functionality of underscore natively. The grandparent may have other reasoning but that would be my first guess.
- slantyyz 15y agoSugar.js is pretty useful too. http://sugarjs.com/ http://sugarjs.com/