DailyJS

Curl Converter, aja.js, sneakpeek

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

libraries ui ajax utilities dom http rest

Curl Converter, aja.js, sneakpeek

Posted by Alex R. Young on .
Featured

libraries ui ajax utilities dom http rest

Curl Converter, aja.js, sneakpeek

Posted by Alex R. Young 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

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:

aja()  
  .method('GET')
  .url('/api/customer')
  .data({ firstname: 'John Romuald' })
  .on('200', function(response) {})
  .go();

It also supports some DOM manipulation:

aja()  
  .url('/views/page.html')
  .into('.container')
  .go();

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

sneakpeek

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.