Skip to content

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

Notifications You must be signed in to change notification settings

jmac105/examine-instance

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

examine-instance

Greenkeeper badge

Build Status

examine-instance inspects an object and its prototype and catalogues the properties and methods.

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;
  }
}

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

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

*/

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%