# manga-js-http-sdk

> Client access manga-js-server by http

Latest version **1.2.6** (published 2024-12-20) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install manga-js-http-sdk
pnpm add manga-js-http-sdk
yarn add manga-js-http-sdk
bun add manga-js-http-sdk
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.6 |
| Published | 2024-12-20 |
| First published | 2023-03-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Renato Miawaki |
| Maintainers | reytuty |
| Keywords | manga, http, sdk, memcache, statemachine |

## Links

- npm: https://www.npmjs.com/package/manga-js-http-sdk
- Repository: https://github.com/state-machine-solutions/manga-js-http-sdk
- Homepage: https://github.com/state-machine-solutions/manga-js-http-sdk#readme
- Issues: https://github.com/state-machine-solutions/manga-js-http-sdk/issues
- npm.io page: https://npm.io/package/manga-js-http-sdk

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^1.6.5
- [@types/axios](https://npm.io/package/@types/axios.md) ^0.14.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.2.6 (latest) — 2024-12-20
- 1.2.5 — 2024-12-20
- 1.2.4 — 2024-12-20
- 1.2.3 — 2024-06-23
- 1.2.2 — 2024-06-23
- 1.2.1 — 2024-01-11
- 1.2.0 — 2024-01-11
- 1.1.2 — 2024-01-05
- 1.1.1 — 2024-01-05
- 1.1.0 — 2024-01-05
- 1.0.2 — 2023-05-22
- 1.0.1 — 2023-03-29
- 1.0.0 — 2023-03-29

## README

# manga-js-http-sdk

Sdk Client to http calls on manga server project

## Usage

### import

```
import { HttpManga } from "manga-js-http-sdk"

const httpManga = new HttpManga("http://localhost:80");

```

## SET

```
httpManga.set("your.path.here", { yourValueHere: true, anything:[1,2,3]}).then((r)=>{
    console.log(r);
});
```

## SET with timeout and garbage collector

It just works if the server is setted to use garbage collector `USE_TEMP_DATA=true` on server env

```
const timeoutInSecconds = 3;
//after 3 secconds server execute delete to your.path.here
httpManga.set("your.path.here", { yourValueHere: true, anything:[1,2,3]}, timeoutInSecconds).then((r)=>{
    console.log(r);
});
```

## GET

```
httpManga.get("your.path.here").then((r)=>{
    console.log(r);//here he value saved on your.path.here
});
```

## RESET

```
httpManga.reset("your.path.here", { yourValueHere: true, anything:[1,2,3]}).then((r)=>{
    console.log(r);
});
```

## RESET with timeout and garbage collecotr

It just works if the server is setted to use garbage collector `USE_TEMP_DATA=true` on server env

```
const timeoutInSecconds = 3;
//after 3 secconds server execute delete to your.path.here
httpManga.reset("your.path.here", { yourValueHere: true, anything:[1,2,3]}, timeoutInSecconds ).then((r)=>{
    console.log(r);
});
```

## DELETE

```
httpManga.delete("your.path.here").then((r)=>{
    console.log(r);
});
```

## CLEAR

```
httpManga.clear().then((r)=>{
    console.log(r);//there is no more data on server
});
```

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