lazydef

0.0.3 • Public • Published

lazydef Build Status

Lazy getter helper

#Usage

var lazyDef = require('lazydef');
var obj = {};

function doSomethingSoHard () {
    return 42;
}

lazyDef(obj, 'foo', doSomethingHard);

//  foo will be executed once
assert.strictEqual(obj.foo, 42);
assert.strictEqual(obj.foo, 42);

License MIT

Readme

Keywords

Package Sidebar

Install

npm i lazydef

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • golyshevd