1.0.0 • Published 2 years ago

@arynthernium/lockject v1.0.0

Weekly downloads
-
License
Unlicense
Repository
github
Last release
2 years ago

lockject

Locked Javascript objects.

Why?

No real reason. This is pretty much useless. I just thought it would be an interesting concept to make and so I am.

Usage

Install

npm install @arynthernium/lockject

Import (ES6)/Require (CommonJS)

// ES6
import { Locked } from '@arynthernium/lockject';
// CommonJS
const { Locked } = require('@arynthernium/lockject');

Usage

const o = new Locked({ five: 5 }, 'key');
// returns a new instance of Locked containing the object

o.unlock('key');
// returns { five: 5 }

Both arguments can be anything of any type, and will be stored in private class fields.