You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

ajx

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajx

Simple fetch library for me.


Version published
Weekly downloads
174
increased by89.13%
Maintainers
1
Install size
71.4 kB
Created
Weekly downloads
 

Readme

Source

ajx

npm version Downloads/month Build Status Dependency Status

Simple fetch library for me.

💿 Installation

Use npm.

$ npm install --save ajx

📖 Usage

API reference is /docs.

const ajx = require("ajx")

async showExampleCom() {
    // Send a HTTP GET request.
    const html = await ajx.get("http://example.com/")
    console.log(html)
}

showExampleCom()

The requests are cancellable.

const ajx = require("ajx")

async showExampleCom(cancelToken) {
    const html = await ajx.get("http://example.com/", {cancelToken})
    console.log(html)
}

const ct = ajx.CancelToken.new()
showExampleCom(ct).catch(error => {
    if (ajx.isCancel(error)) {
        console.log("canceled:", error.message)
    } else {
        console.error("some errors:", error.message)
    }
})
ct.cancel("some reason")

📰 Changelog

💪 Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test runs tests.
  • npm run docs opens the current documents by your default browser.
  • npm run update-docs generates documents from the current source code.
  • npm run watch runs tests and measures coverage when source code are changed.

FAQs

Package last updated on 03 Mar 2017

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc