meta-for

0.0.2 • Public • Published

meta-for NPM version Build Status Dependency Status Coverage percentage

Get and set your own un-collidable meta properties on objects. Powered by Symbols.

Install

$ npm install --save meta-for

Usage

import metaFor from 'meta-for';
 
let obj = {};
let meta = metaFor(obj); // meta is writable
meta.someMetaProperty = true;
let meta = metaFor(obj, true); // meta is read-only
meta.someMetaProperty === true
 
for (var prop in obj) {
  // The meta property won't appear here!
  // It's also impossible to collide with another property,
  // thanks to the magic of Symbols
}

Package Sidebar

Install

npm i meta-for

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • davewasmer