# private-store

> Allows to set private variables in a Javascript Class

Latest version **1.0.0** (published 2017-09-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install private-store
pnpm add private-store
yarn add private-store
bun add private-store
```

## 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.0 |
| Published | 2017-09-04 |
| First published | 2017-09-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | nodejayes |

## Links

- npm: https://www.npmjs.com/package/private-store
- Repository: https://github.com/nodejayes/private-store
- Homepage: https://github.com/nodejayes/private-store#readme
- Issues: https://github.com/nodejayes/private-store/issues
- npm.io page: https://npm.io/package/private-store

## Dependencies (1)

- [uuid](https://npm.io/package/uuid.md) ^3.1.0

## Recent versions

- 1.0.0 (latest) — 2017-09-04

## README

# private-store
Allows to set private variables in a Javascript Class

## Example

```javascript
const PrivateStore = require('private-store');

class TestClass {
    constructor () {
        // register a new private store
        this.id = PrivateStore.register();
        PrivateStore.write(this.id, 'name', null);
    }

    dispose() {
        // clear the private store
        PrivateStore.clear(this.id);
    }

    get Name () {
        // read a value from private store
        return PrivateStore.read(this.id, 'name');
    }

    setMyName (name) {
        // write a value in private store
        PrivateStore.write(this.id, 'name', name);
    }
}
module.exports = TestClass;
```

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