{"library":"private","type":"library","category":null,"description":"The `private` package (version 0.1.8) provides a utility for associating truly private state with any JavaScript object, predating native private class fields. It achieves this primarily through two mechanisms: `makeAccessor`, which uses closures to create a secret object accessible only via a dedicated accessor function, and `makeUniqueKey`, which generates non-enumerable, unguessable property names. A crucial update in v0.1.2 addressed memory leak issues by ensuring secret objects are directly (but securely) stored on owning objects, allowing them to be garbage collected when the owner becomes unreachable. This package, last updated significantly years ago, is largely superseded by modern JavaScript features like private class fields (`#field`) but historically offered a robust solution for encapsulation in ES5 environments.","language":"javascript","status":"abandoned","version":"0.1.8","tags":["javascript","private","access control","access modifiers","encapsulation","secret","state","privilege","scope"],"install":[{"cmd":"npm install private","imports":["const getSecret = require('private').makeAccessor();","const secretKey = require('private').makeUniqueKey();","const Private = require('private');"]},{"cmd":"yarn add private","imports":[]},{"cmd":"pnpm add private","imports":[]}],"homepage":null,"github":"https://github.com/benjamn/private","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/private","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/private/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Sat Jul 18","install_tag":null}}