Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prr

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prr

A better Object.defineProperty()

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9M
decreased by-60.35%
Maintainers
1
Weekly downloads
 
Created

What is prr?

The npm package 'prr' provides a simple and effective way to set properties on objects with specific property attributes in JavaScript. It is particularly useful for managing property descriptors with ease, allowing developers to control enumerable, writable, and configurable attributes.

What are prr's main functionalities?

Setting properties with custom attributes

This feature allows the setting of properties on an object while defining their attributes such as enumerable, writable, and configurable. The example shows how to set a non-enumerable property, which will not show up in Object.keys() but is still accessible on the object.

const prr = require('prr');

let obj = {};
// Setting a non-enumerable property
prr(obj, 'secret', 'hidden value', 'e');

console.log(Object.keys(obj)); // Will not show 'secret'
console.log(obj.secret); // Outputs 'hidden value'

Other packages similar to prr

Keywords

FAQs

Package last updated on 01 Apr 2013

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc