# obstinate

> Simple global object persistance with Node.js

Latest version **0.0.3** (published 2015-02-05) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-02-05 |
| First published | 2015-02-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Edward Lombe |
| Maintainers | edward-lombe |
| Keywords | object, persistance, saving, json, global |

## Links

- npm: https://www.npmjs.com/package/obstinate
- Repository: https://github.com/Edward-Lombe/obstinate
- Issues: https://github.com/Edward-Lombe/obstinate/issues
- npm.io page: https://npm.io/package/obstinate

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.3 (latest) — 2015-02-05
- 0.0.2 — 2015-02-05
- 0.0.1 — 2015-02-05

## README

# obstinate
---
A simple reference based interface for easy watching and saving of Javascript objects

# How to install
---
`npm install obstinate`

# How to use
---
Usage right now is fairly simple. If control over the resultant watch object is not required, it can be set up as follows by passing a reference to the object you wish to persist.

```javascript
var obstinate = require('obstinate'),
	obj = {};

obstinate('obj', obj).start();
```

All changes to the object will (hopefully) be persisted. If control over the watch object is needed, simply assign a var to the return value of the obstinate function as such.

```javascript
var	obj = {},
	objControl = obstinate('obj', obj);

// Start watching the object
objControl.start();

// Stop watching the object
objControl.stop();

// Remove the object completely
objControl.remove();

// Manually call save
objControl.save();

```

Additionally a third options argument can be passed to the obstinate in order to change some of the default parameters.

```javascript
var	obj = {},
	options = {
		// The folder in which to save the files
		filepath : 'data/',
		// The delay between each check of the object in ms
		delay : 200
	},
	objControl = obstinate('obj', obj, options);
```

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