New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

examine-instance

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

examine-instance

Inspects an object and its prototype and catalogues the properties and methods.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22
decreased by-35.29%
Maintainers
1
Weekly downloads
 
Created
Source

examine-instance

Greenkeeper badge

Build Status

examine-instance inspects an object and its prototype and catalogues the properties and methods. Categorises methods as private if they are prefixed or suffixed by an underscore, otherwise marks as public.

Installation

npm install examine-instance -S

Usage


import examine from "examine-instance";

class MyClass {

  constructor() {
    this._property1 = "";
    this._isGood = true;
  }

  get isGood() { return this._isGood; }
  get property1() { return this._property1; }
  set property1(value) { this._property1 = value; }

  method1(value) {
    return value;
  }

  method2_(value) {
    return value;
  }
}

const instance = new MyClass();
const result = examine(instance);

/*
{
  methods: [ 'method1', 'method2_' ],
  privateMethods: [ 'method2_' ],
  publicMethods: [ 'method1' ],
  attributes: [ '_property1', '_isGood' ],
  readOnly: [ 'isGood' ],
  readWrite: [ 'property1' ],
  writeOnly: []
}

*/

Keywords

FAQs

Package last updated on 20 Nov 2019

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