A browscap.ini parser in JavaScript

I use PHP’s get_browser function to identify web browsers from user agent strings on several sites. I wanted this ability in a node.js application I’m writing, so I wrote a JavaScript implementation to use.

You can get it here: http://github.com/dangrossman/node-browscap

It includes a parser for browscap.ini files from the Browser Capabilities Project site, converting the patterns from that file to regular expressions JavaScript can compile and match user agents against. The matched browser’s properties are returned as an associative array.