# js-transmission

> Be based on Asynchronous Javascript And XML

Latest version **1.1.6** (published 2018-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-transmission
pnpm add js-transmission
yarn add js-transmission
bun add js-transmission
```

## 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.6 |
| Published | 2018-08-26 |
| First published | 2017-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | 603803799@qq.com |
| Maintainers | notescript |
| Keywords | js接口请求, javascript请求, http, Fetch, ajax, js-ajax, Asynchronous Javascript And XML, js-api, promise-ajax |

## Links

- npm: https://www.npmjs.com/package/js-transmission
- Repository: https://github.com/noteScript/js-transmission
- Homepage: https://github.com/noteScript/js-transmission/#readme
- Issues: https://github.com/noteScript/js-transmission/issues
- npm.io page: https://npm.io/package/js-transmission

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.6 (latest) — 2018-08-26
- 1.1.5 — 2018-04-02
- 1.1.4 — 2018-04-01
- 1.1.3 — 2018-04-01
- 1.1.2 — 2018-03-16
- 1.1.1 — 2018-03-15
- 1.0.8 — 2018-03-01
- 1.0.7 — 2018-03-01
- 1.0.6 — 2018-03-01
- 1.0.5 — 2017-12-26
- 1.0.4 — 2017-12-05
- 1.0.3 — 2017-11-30
- 1.0.2 — 2017-11-30
- 1.0.1 — 2017-11-26
- 1.0.0 — 2017-11-25

## README

> transmission.js@1.1.6

##### matters needing attention

Be based on Asynchronous Javascript And XML！
In the future version, Access to Fetch API!

## install transmission.js

```bash

npm install js-transmission --registry=https://registry.npm.taobao.org

```

## use transmission.js

> ES6 import

``` javascript

// For the sake of standardization, only support ES6 module!
import transmission from 'js-transmission';

transmission({
  url: "https://baidu.com",
  type: "GET",
  async: false,
  header: {
    'User-Agent': 'js-transmission'
  },
  data() {
    return {
      message: "hello transmission.js!"
    }
  },
  beforeSend() {
    // modify data
    return { // modify data
      message: "hello world!"
    }
  },
  sending() {
    //so do...
  },
  sent() {
    //so do...
  },
  inProcess() {
    //so do
  },
  beforeSuccess: (data, sendObject, ResponseHeaders) => {
    // data, sendObject, ResponseHeaders
    console.log(data)
    console.log(sendObject)
    console.log(ResponseHeaders)
  },
  success(response, headers) {
    // typeof response === 'object' //true
    console.dir(response),
    console.dir(headers)
  },
  error(error, statusData) {
    console.warn(error);
    console.dir(statusData)
  }
});

//GET example

transmission('https://baidu.com?search=transmission.js')
  .then(r => {
    console.dir(r)
  })
  .catch(e => {
    console.error(e)
})

//POST example

transmission({
  url: 'https://baidu.com',
  type: "POST",
  data:{message:"hello world!"}
})
.then(r => {
  console.dir(r)
})
.catch(e => {
  console.error(e)
})



```
##  License

[MIT](http://opensource.org/licenses/MIT)

[transmission.js@1.1.6](https://github.com/noteScript/js-transmission.git)

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