npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

jquery.request

v1.0.9

Published

Jquery plugin developed to standardize and facilitate the way you make ajax requests

Readme

Description

This jquery plugin helps makes ajax request in a standard way.

Version history

Version 1.0.9
- Added git repository

Version 1.0.8
- Changed the license from ISC to MIT
- Updated some comment

Configuration options

Next a list of all supported configuration options:

**async**: true/false, default true;	
**cache**: true/false, default true;
**contents**: string, default is '';	
**contentType**: string, default is 'application/x-www-form-urlencoded; charset=UTF-8';	
**crossDomain**: true/false, default false;	
**data**: string, default is '';	
**dataType**: string, default is 'html';	
**headers**: string, default is '';	
**password**: string, default is '';	
**timeout**: integer, default is 300000;	//5 minutes
**type**: GET/POST and any type supported by jquery, default is 'GET';	
**url**: string, default is '';	
**username**: string, default is '';

These are the same supported by jquery, see it for further details. Next are the event supported by the library:

**onRequestBeforeSend**: execute before request is executed, useful to create a loader or spinner in the ui
**onRequestError**: triggered if request fails
**onRequestSuccess**: triggered on success, like jquery
**onRequestComplete**: triggered when request ends (after onRequestSuccess events)

Use

  1. Include jquery library (version >=1.5)
  2. Include jquery.request.js or jquery.request.min.js library
  3. Next write your custom function to process request as this one:
	function requestExample() {
		//Object containing the configuration plugin options
		var options = new Object();
		try {
			options["onRequestBeforeSend"] = function (context, jqXHR, settings) {
				try {
					//Useful to perform actions before the request execution
				} catch (ex) {
					alert("onRequestBeforeSend:"+ex.message)
				}
			}
			
			options["onRequestSuccess"] = function (context, key) {
				try {
					//getting response
					var objResp = context.getResponse();

				} catch (ex) {
					alert("onRequestSuccess:"+ex.message)
				}
			}

			options["onRequestError"] = function (context, XMLHttpRequest, textStatus, errorThrown) {
				try {
					alert(errorThrown);
				} catch (ex) {
					alert("onRequestError:"+ex.message)
				}
			}
	
			 //Create the instance with the options
			var req = new $.request(options);

			//Url to call: you can define it directly in the options object before 
			req.addRequestParam("url", 'http://www.google.com');

			//Change some defualt options value
			//Cache
			req.addRequestParam("cache", false);

			//data to send along with the request
			req.addRequestParam("data", { "code": "001", "description": "Hello world" });

			.......

			//Perform the request
			req.makeRequest();

		} catch (ex) {
			alert("requestExample:"ex.message)
		}
	}