0.0.2 • Published 9 years ago

meta-for v0.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

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
}