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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@stanimirdim92/ajaxify

v0.1.5

Published

Javascript ajax library with simillar jQuery syntax

Downloads

1

Readme

Ajaxify

This is a vanilla Javascript AJAX library. The syntax is similar to jQuery.

Build Status

Supported data types:

  • JSON
  • Document
  • Text
  • XML
  • Blob
  • ArrayBuffer
  • No JSONP support, sorry. Use CORS!

Installation

Available on Bower as stanimirdim92-ajaxify.

$ bower install stanimirdim92-ajaxify

Available on NPM as @stanimirdim92/ajaxify.

$ npm install @stanimirdim92/ajaxify

How to use:

FormData

var formData = new FormData();
formData.append('da', 'da=da&asd=dsa');
formData.append('id', 123456);

ajaxify.ajax({
    url: 'test.php',
    method: "POST",
    data: formData,
    dataType: "text",
    processData: false,
    contentType: false,
    headers: {
        "my-Awes0mE-H3ad3R": "header4e"
    }
}).done(function (response, headers, XHR) {
    console.log(response);
    console.log(headers);
    console.log(XHR);
});

Array

var arr = [10, 20, 30, 'yes', 'no'];

ajaxify.ajax({
    url: 'test.php',
    method: "POST",
    data: arr,
    headers: {
        "my-Awes0mE-H3ad3R": "header4e"
    }
}).done(function (response, headers, XHR) {
    console.log(response);
    console.log(headers);
    console.log(XHR);
});

Text

var t = "yes=thisisatext&no=thisisnotatext";

ajaxify.ajax({
    url: 'test.php',
    method: "POST",
    data: t,
    headers: {
        "my-Awes0mE-H3ad3R": "header4e"
    }
}).done(function (response, headers, XHR) {
    console.log(response);
    console.log(headers);
    console.log(XHR);
});

Object

var obj = {
    yes: 'thisIsCamelCase'
};

ajaxify.ajax({
    url: 'test.php',
    method: "POST",
    data: obj,
    headers: {
        "my-Awes0mE-H3ad3R": "header4e"
    }
}).done(function (response, headers, XHR) {
    console.log(response);
    console.log(headers);
    console.log(XHR);
});

XML

####### From PHP file. The script will return plain text, which we parse as XML document ajaxify.ajax({ url: 'test.php', method: "GET", headers: { "my-Awes0mE-H3ad3R": "header4e" } }).done(function (response, headers, XHR) { console.log(ajaxify.parseXML(response)); console.log(headers); console.log(XHR); });

####### Directly from XML file. The script will return an XML object ajaxify.ajax({ url: 'test.xml', method: "GET", headers: { "my-Awes0mE-H3ad3R": "header4e" } }).done(function (response, headers, XHR) { console.log(response); console.log(headers); console.log(XHR); });

Blob

ajaxify.ajax({
    url: 'ajax-icon-big.jpg',
    responseType: 'blob',
    method: "GET",
    headers: {
        "my-Awes0mE-H3ad3R": "header4e"
    }
}).done(function (response, headers, XHR) {
    var blob = ajaxify.parseBlob(response, 'image/jpeg');

    document.querySelector('#imgId').src = blob;
});

ArrayBufer

ajaxify.ajax({
    url: 'ajax-application-development.jpg',
    responseType: 'arraybuffer',
    method: "GET",
    headers: {
        "my-Awes0mE-H3ad3R": "header4e"
    }
}).done(function (response, headers, XHR) {
    var buffer = ajaxify.parseArrayBuffer(response, Uint8Array, 'image/jpeg');

    document.querySelector('#imgId').src = buffer;
});

TODO:

  • File upload
  • Progress bar