Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

najax

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

najax

fast, flexible, unit-tested jquery-ajax-stye serverside requests

  • 0.1.31
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40K
decreased by-3.1%
Maintainers
1
Weekly downloads
 
Created
Source

najax

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

It features very flexible method overloads to suit various styles, including with jquery style deferreds.

It seamlessly handles ssl and makes some reasonable assumptions based on inputs but as usual everything can be overridden by passing an options object.

The x is a lie.

Getting Started

Install the module with: npm install najax

var najax = require('najax');
najax('http://www.google.com', function(html){ console.log(html); }); // "awesome"
najax('http://www.google.com', { type:'POST' }, function(html){ console.log(html); }); // "awesome"
najax({ url:'http://www.google.com', type:'POST', success: function(html){ console.log(html); }); // "awesome"
najax({ url:'http://www.google.com', type:'POST' }).success(function(resp){}).error(function(err){}); // "awesome"

najax.get, najax.post, najax.put, najax.delete...

Run unit tests

  • cd dir
  • npm -g install grunt
  • npm install
  • grunt test

Examples

(Coming soon)

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 grunt.

License

Copyright (c) 2012 Alan Clarke
Licensed under the MIT license.

FAQs

Package last updated on 08 Aug 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc