What is the leading LINQ for JavaScript library?

Tom Tresansky picture Tom Tresansky · Mar 19, 2010 · Viewed 41.6k times · Source

I'm looking for a JavaScript library that will allow me to query complex JSON objects using a LINQ-like syntax. A quick search found a couple of promising options that look they might offer what I need:

LINQ to JavaScript and jLinq

  • Does any one have any experience using them?
  • What are some pros and cons?
  • Is the performance comparable?
  • Does the function-passing syntax of LINQ to JavaScript offer any hidden benefits (I personally find the syntax of jLinq more appealing on first glance)?
  • What have you found lacking in either project?
  • Did you ever try contacting the authors? How responsive were they?
  • What project is more widely used?

I think it will be the first one to get a thorough try-out.

Answer

Nathan Palmer picture Nathan Palmer · Apr 4, 2011

You might want to check out linq.js. It follows the .NET lambda syntax and looks to be well integrated in a Microsoft environment.

LINQ for JavaScript - http://linqjs.codeplex.com/

Pros

  • Implements all .NET 4.0 methods
  • Complete lazy evaluation
  • Full IntelliSense support for VisualStudio
  • Supports jQuery
  • Supports Windows Script Host
  • Binding for Reactive Extensions for JavaScript(RxJS) and IntelliSense Generator
  • NuGet install support
  • Updated recently (last release Jan 2011)
  • Syntax conforms to lambda syntax in C#

Cons

  • The linq.js library is a little large.
  • If you are already using jQuery or other js library, the most commonly used functionality is probably already available. See especially jQuery's filter, and 'Any' methods.