Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including utiljs-privates with all npm packages installed. Try it out:

var utiljsPrivates = require("utiljs-privates")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

utiljs-privates v0.29.0

JavaScript utility class for private member variables

utiljs-privates

JavaScript utility class for private member variables

NPM Status

utiljs-privates is part of Util.js.

Privates

JavaScript utility class for private member variables.

This class decreases some of the boilerplate of the WeakMap pattern as described by "Private Variables in JavaScript with ES6 WeakMaps" and "Privates In ES2015 Javascript Classes". This utility handles shallow copying at construction.

Use of this class should end once private fields become a part of the ECMA standard. The following is a StackOverflow answer to the question "Private properties in JavaScript ES6 classes": "Private fields are being implemented in the ECMA standard. You can start using them today with babel 7 and stage 3 preset."

Kind: global class
Access: public

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free