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

private-props

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

private-props

Private property simulation for javascript

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

private-props

Version Simulation of private property for javascript (though private property isn't that needed in javascript), this module would probably be useless.

Installation

npm install -S private-props

Usage

// sample usage on how to use this module
let props = require('private-props')

class Foo {
    constructor() {
        /** now this properties won't be accessible to the outside world */
        props(this).width = 100
        props(this).height = 100
        /** this is publicized properties */
        this.weight = 50
    }

    // accessing property from within class
    getWidth() {
        return props(this).width
    }
}

module.exports = Foo

Issues

  • somehow the content of the class is visible if you supply an instantiated version of the class

Keywords

FAQs

Package last updated on 13 Nov 2017

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