# rajaapi

> raja api simple package

Latest version **1.0.4** (published 2018-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install rajaapi
pnpm add rajaapi
yarn add rajaapi
bun add rajaapi
```

## 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.0.4 |
| Published | 2018-10-20 |
| First published | 2018-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| Author | balinux |
| Maintainers | balinux |
| Keywords | raja api, javascript, promise |

## Links

- npm: https://www.npmjs.com/package/rajaapi
- npm.io page: https://npm.io/package/rajaapi

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.18.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2018-10-20
- 1.0.2 — 2018-10-20
- 1.0.1 — 2018-10-20
- 1.0.0 — 2018-10-20

## README

# rapi

simple Raja api package for the browser and node.js

## Features

- get Data raja APi
- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API
- Automatic transforms for JSON data

## Installing

Using npm:

```
$ npm i rajaapi
```


## Example

Performing a `GET` request

```js
const rapi = require('rajaapi')

const api = new rapi({ token: 'your token' })

//   get provinsi
api.rajaProvinsi()
  .then(data => {
    console.log(data)
  })
  .catch(Error => {
    console.log(Error)
  })

//   get kabupaten
  api.rajaKabupaten(51)
  .then(data => {
    console.log(data)
  })
  .catch(Error => {
    console.log(Error)
  })

//   get kecamatan
  api.rajaKecamatan(5103)
  .then(data => {
    console.log(data)
  })
  .catch(Error => {
    console.log(Error)
  })  

//   get kelurahan
    api.rajaKelurahan(5103010)
  .then(data => {
    console.log(data)
  })
  .catch(Error => {
    console.log(Error)
  })  


// Want to use async/await? Add the `async` keyword to your outer function/method.
async function getUser() {
  try {
    const response = await api.rajaKelurahan(5103010);
    console.log(response);
  } catch (error) {
    console.error(error);
  }
}
getUser()
```

## License

MIT

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