The JavaScript blog.


libraries ui ajax utilities dom http rest

Curl Converter, aja.js, sneakpeek

Posted on .

Curl Converter

Chrome's "Copy as cURL" menu item is useful, but what if you want to duplicate the same request with Node? Curl Converter (GitHub: NickCarneiro/curlconverter, License: MIT, npm: curlconverter) by Nick Carneiro can convert between cURL syntax and Node's popular request module. It also supports Python, and can be installed with npm.


aja.js (Bower: aja, npm: aja, License: MIT) by Bertrand Chevrier is an Ajax library that supports JSON and JSONP. It can be used to load large chunks of HTML or JSON, and can be installed with npm or Bower.

The API is fluent, so it can be used as a REST client like this:

  .data({ firstname: 'John Romuald' })
  .on('200', function(response) {})

It also supports some DOM manipulation:


It comes with tests that can be run with Grunt, and the readme has more examples for things like posting data.


If you're looking for a library to hide the header when the page is scrolled, then sneakpeek (GitHub: antris/sneakpeek, License: MIT, npm: sneakpeek) is nice because it's small, installable with npm, and has no external dependencies.

It's a bit like headroom.js, but easier to use with Browserify.


language utilities


Posted on .

I just finished reading about Angus Croll's
tracer utility -- a tiny pure JavaScript method tracer. It traverses prototype
chains and wraps each method in a new function that calls the tracer's

To understand this, remember that functions on objects can be iterated
over. Also recall that functions in JavaScript are first class objects,
which means they can be decorated with properties. Combining these two
facts allows object methods to be iterated over and safely modified to
call external code.

This can even be done recursively:

tracer.traceAll(jQuery, true)
>> tracing init
>> tracing size
>> tracing toArray
// ...

The source code is in the article: A tracer utility in