Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
define-prop
Advanced tools
#define-prop
###Easy and type safe custom object property define
###Usage:
<object> defineProperty( <object> obj, <string>/<number> key, <any type> value, <string> descriptorNames )
Default, the enumerable, configurable and writable descriptor values are set to false, which is the default behaviour of Object.defineProperty. You can set them individually to true by passing their names as last argument in a space seperated string.
var defineProperty= require( 'define-prop' );
var obj= {};
// let's define obj.hello and give it the value 'world!', it will be
// immutable by default, we only set enumerable to be able to log it now
defineProperty( obj, 'hello', 'world!', 'enumerable' );
obj.hello= 'into a black hole';
console.log( obj );
// { hello: 'world!' }
// define a getter and setter as you would with Object.defineProperty
defineProperty( obj, 'count', {
get: () => obj.value
,set: ( value ) => obj.value= value
});
obj.count= 0;
console.log( ++obj.count );
// 1
0.0.3
--
###license
MIT
FAQs
Easy and type safe custom object property define
The npm package define-prop receives a total of 9 weekly downloads. As such, define-prop popularity was classified as not popular.
We found that define-prop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.