website/node_modules/define-property/README.md

define-property NPM version

Define a non-enumerable property on an object.

Install

Install with npm

$ npm i define-property --save

Usage

Params

var define = require('define-property');
var obj = {};
define(obj, 'foo', function(val) {
  return val.toUpperCase();
});

console.log(obj);
//=> {}

console.log(obj.foo('bar'));
//=> 'BAR'

get/set

define(obj, 'foo', {
  get: function() {},
  set: function() {}
});

Related projects

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.

This file was generated by verb-cli on August 31, 2015.



JohnCoene/chirp documentation built on May 25, 2021, 6:33 p.m.