# diffme

> Official SDK for diffme (supports TS!)

Latest version **1.0.0** (published 2021-08-19) · ISC license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-08-19 |
| First published | 2021-08-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 35.2 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | aduca98 |

## Links

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

## Dependencies (1)

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

## Recent versions

- 1.0.0 (latest) — 2021-08-19
- 0.1.2 — 2021-08-19
- 0.1.0 — 2021-08-19
- 0.0.1 — 2021-08-19

## README

## Diffme JS

[![Publish to NPM only from Master branch](https://github.com/diffme-dev/diffme-js/actions/workflows/publish.yml/badge.svg)](https://github.com/diffme-dev/diffme-js/actions/workflows/publish.yml)

This SDK is to interact with the diffme API and track changes/deltas for your documents/database rows. 

You can use this SDK to easily communicate with a hosted diffme server as it provides a clean wrapper around 
the snapshot and change APIs. 

The library also has full TS support for those of you that like that :)


```typescript
import diffmeSDK from "diffme"

const diffme = diffmeSDK({ 
    domain: "https://your-hosted-domain",
    apiKey: "your api key"
})

const document = { name: "Chaga", price: 10.50, id: "1"}

diffme.snapshots.create({
    reference_id: document.id,
    data: document,
    editor: "andrew",
})

// edit the documents name
document.name = "Chagachino"

// this would create a diff saying the name was changed 
// from "Chaga" to "Chagachino" by olivia
diffme.snapshots.create({
    reference_id: document.id,
    data: document,
    editor: "olivia",
}) 

// get the changes for this document over time
diffme.changes.forReferenceId(document.id)

// or search for them!
diffme.changes.search({
    editor: "andrew", // optional
    field: "name", // optional
    value: "ch", // optional as you type!
})
```

If you have any questions you can email andrew.j.duca@gmail with a subject of "Diffme questions". Feedback is welcome.

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