# changekit

> A simple toolkit that integrates with your iOS and Android apps, along with your server, to make data usage efficient.

Latest version **1.0.9** (published 2018-06-01) · 0 weekly downloads

## Install

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

## 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.9 |
| Published | 2018-06-01 |
| First published | 2018-05-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 30.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jordan Osterberg |
| Maintainers | josterberg |

## Links

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

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^3.2.1
- [mysql](https://npm.io/package/mysql.md) ^2.15.0

## Recent versions

- 1.0.9 (latest) — 2018-06-01
- 1.0.8 — 2018-05-25
- 1.0.7 — 2018-05-25
- 1.0.6 — 2018-05-25
- 1.0.5 — 2018-05-25
- 1.0.3 — 2018-05-24
- 1.0.2 — 2018-05-24
- 1.0.1 — 2018-05-24
- 1.0.0 — 2018-05-24

## README

# ChangeKit  ![version](https://img.shields.io/badge/version-1.0.8-red.svg)
 ChangeKit is a simple framework that integrates with your iOS and Android apps, along with your server, to make data usage efficient.
 
 **ChangeKit is a work in progress tool, and should not be deployed in production until specified in this README.**
 
 ChangeKit requires the `mysql` library. To initialize ChangeKit, simply:
 ```javascript
const changekit = require("changekit")({
    mysqlDatabase: database
});
```

From here, whenever a data request is made, ChangeKit should be queried to see if the client's cached data is outdated. Using `express` would look like this:
```javascript
// Listen for localhost:3000/home/v1/get
app.get("/home/v1/get", function(req, res) {
    // If you have a resource that is frequently accessed, consider caching it
    changekit.stubForResource("home").then((stub) => {
        // If there is no update required, inform the client 
        if (!changekit.shouldUpdate(req, stub)) {
          res.status(200).json({updateRequired: false})
          return
        }

        // Now load data that is used to power this endpoint
        res.status(200).json({updateRequired: true})
    })
});
```  

If you aren't using `express`, there will be an alternative method for you to call soon.

Again, this is a work in progress tool, and it should not be deployed to production until specified in this README. Check back soon for updates.

Copyright © 2018 Jordan Osterberg. All rights reserved. Licensed under the MIT license.

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