Posts

Showing posts with the label jslib

Directories for JavaScript resources

I recently asked on Twitter whether people knew any good directories for JavaScript libraries and got several good answers. I was only aware of the following two directories: “ JSDB : a collection of the best JavaScript libraries” “ Microjs : fantastic micro-frameworks and micro-libraries for fun and profit” More directories: “ JavaScriptOO : every JavaScript project you should be looking into” (via @getify). “ JSter : a catalog of JavaScript libraries and tools for web development” (via @check_ca) “ Unheap : a tidy repository of jQuery plugins” (via @fredrik_sogaard) “ Master List of HTML5, JavaScript, and CSS Resources ” by Gene Loparco Obviously, you can always directly browse the registries of package managers (as suggested by Manuel Strehl). For example: npm (Node Packaged Modules) Bower Directories for CDNs (content delivery networks, [1] ) and CDN content (via @elijahmanor): jsDelivr : free CDNs for JavaScript libraries, j...

JavaScript’s regular expressions: more fun with XRegExp

Reminder: As soon as your JavaScript regular expressions become more complicated, you should probably use Steven Levithan’s XRegExp library. The cool thing about XRegExp is that it internally compiles its extended regular expressions to normal regular expressions, meaning that they are fast. Let’s look at some of XRegExp’s highlights, quoted from the XRegExp website. Highlights: insignificant whitespace, inline comments, named groups var date = XRegExp('(?<year> [0-9]{4} ) -? # year \n' + '(?<month> [0-9]{2} ) -? # month \n' + '(?<day> [0-9]{2} ) # day ', 'x'); The above example demonstrates three features: First, the x flag makes whitespace insignificant in regular expressions. You can spread out things as much as you like and the regular expression becomes more readable. Regular expressions can be awfully crowded; this helps. Second, with the x flag, you also get inlin...