# @page-libs/ajax

> Ajax plugin for Page framework.

Latest version **1.1.8** (published 2019-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @page-libs/ajax
pnpm add @page-libs/ajax
yarn add @page-libs/ajax
bun add @page-libs/ajax
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.8 |
| Published | 2019-09-06 |
| First published | 2018-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 27.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | guseyn |
| Maintainers | guseyn |
| Keywords | cutie, ajax, page |

## Links

- npm: https://www.npmjs.com/package/@page-libs/ajax
- Repository: https://github.com/Guseyn/page-ajax
- Homepage: https://github.com/Guseyn/page-ajax#readme
- Issues: https://github.com/Guseyn/page-ajax/issues
- npm.io page: https://npm.io/package/@page-libs/ajax

## Dependencies (8)

- [@cuties/fs](https://npm.io/package/@cuties/fs.md) ^1.2.4
- [@cuties/json](https://npm.io/package/@cuties/json.md) ^1.1.1
- [@cuties/wall](https://npm.io/package/@cuties/wall.md) ^1.1.2
- [@cuties/cutie](https://npm.io/package/@cuties/cutie.md) ^1.7.5
- [@cuties/spawn](https://npm.io/package/@cuties/spawn.md) ^1.0.2
- [test-executor](https://npm.io/package/test-executor.md) ^1.2.4
- [@cuties/assert](https://npm.io/package/@cuties/assert.md) ^1.2.2
- [@page-libs/cutie](https://npm.io/package/@page-libs/cutie.md) ^1.1.2

## Recent versions

- 1.1.8 (latest) — 2019-09-06
- 1.1.7 — 2019-09-06
- 1.1.6 — 2019-09-06
- 1.1.5 — 2019-09-05
- 1.1.4 — 2019-05-11
- 1.1.3 — 2019-02-23
- 1.1.2 — 2019-02-23
- 1.1.1 — 2019-02-23
- 1.1.0 — 2019-02-23
- 1.0.5 — 2018-12-01
- 1.0.4 — 2018-12-01
- 1.0.3 — 2018-11-30
- 1.0.2 — 2018-11-21
- 1.0.1 — 2018-11-21
- 1.0.0 — 2018-11-21

## README

# page-ajax

[![NPM Version](https://img.shields.io/npm/v/@page-libs/ajax.svg)](https://npmjs.org/package/@page-libs/ajax)
[![Build Status](https://travis-ci.org/Guseyn/page-ajax.svg?branch=master)](https://travis-ci.org/Guseyn/page-ajax)
[![codecov](https://codecov.io/gh/Guseyn/page-ajax/branch/master/graph/badge.svg)](https://codecov.io/gh/Guseyn/page-ajax)

Ajax plugin for [Page](https://github.com/Guseyn/page/) framework. It's based on the [Async Tree Pattern](https://github.com/Guseyn/async-tree-patern/blob/master/Async_Tree_Patern.pdf).

## Install

`npm install @page-libs/ajax`

## Run test

`npm test`

## Run build

`npm run build`

Package is already built. So, for using in Page you just need to install it.

# Examples

```js
new ResponseFromAjaxRequest({
  url: 'http://localhost:8000/',
  method: 'GET' 
}).call();

```

# Usage

```js
const {
  // Here needed async objects from the table below
} = require('@page-libs/ajax');
```

| Async Object  | Async/sync call | Parameters(default value/description) | Representation result |
| ------------- | ----------------| ---------- | --------------------- |
| `ResponseBody` | `response.body, response = {statusCode, headers, body}` | `response({statusCode, headers, body})` | [body](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/response#Value) |
| `ResponseFromAjaxRequest` | [responseFromAjaxRequest](https://github.com/Guseyn/page-ajax/blob/master/src/custom-calls/responseFromAjaxRequest.js) | `options[, requestBody] (options = {url, method, headers, mimeType, withCredentials, user, password, timeout, progressEvent, uploadProgressEvent},` [requestBody](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send#Parameters)`)` | `response({statusCode, headers, body})` |
| `ResponseHeaders` | `response.headers, response = {statusCode, headers, body}` | `response({statusCode, headers, body})` | `object` |
| `ResponseStatusCode` | `response.statusCode, response = {statusCode, headers, body}` | `response({statusCode, headers, body})` | `number` |

---
_Source: https://npm.io/package/@page-libs/ajax · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
