jQuery ajax-stye http requests in node
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib Fix pass through of keep-alive agent May 19, 2018
test Encode post data contentType including charset Mar 22, 2017
.gitignore cleanup Nov 26, 2015
.npmignore initial commit Aug 1, 2012
.travis.yml remove lodash Jun 18, 2016
LICENSE-MIT initial commit Jul 31, 2012
README.md improve error handling May 25, 2016
package.json 1.0.4 Aug 10, 2018

README.md

najax

Travis CI Dependency Status devDependency Status js-standard-style

jQuery ajax-stye http requests in node

jQuery ajax is stupid simple. This project provides a lightweight wrapper for the nodejs http request object that enables jquery ajax style syntax when making serverside requests to other webpages in node.js

In addition to najax.get, , handles ssl and makes some reasonable assumptions based on inputs and everything can be overridden by passing an options object.

Getting Started

Install the module with: npm install najax

var najax = $ = require('najax')
$.get('http://www.google.com', callback)
najax('http://www.google.com', { type: 'POST' }, callback)
najax({ url: 'http://www.google.com', type: 'POST', success: callback })
najax({ url: 'http://www.google.com', type: 'POST' })
  .success(callback)
  .error(errorHandler)

$.get, $.post, $.put, $.delete...

Run unit tests

  • npm install && npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using standardjs.