jsdump

1.0.6 • Public • Published

JSDump

JSDump is a tool to dump out the information of own and inherited properties from an object, object prototype, and object instance.

JSDump helps people get the information of a JavaScript object at runtime as much as possible.

JSDump requires Node.js version 10.0.0 and up.

JSDump-Web is a version of JSDump specified for web browsers. To access JSDump-Web repository for the details.

Documentation

To see JSDump documentation

Installation

$ npm install jsdump

Usage examples

  const jsdump = require('jsdump');
  
  // prints this message.
  jsdump.info();
  // returns an object that includes dumped out content from class URL.
  jsdump.entriesObj(URL);
  
  // prints the information of class URL to the console.
  jsdump.entriesPrint(URL);
  // prints the serialized information of class URL to the console.
  jsdump.typeEntriesPrint(URL, false);
  
  // writes the information of class URL to a txt file in current directory.
  jsdump.entriesFile(URL);
  /* writes the serialized information of class URL to a txt file 
     in current directory. */
  jsdump.entriesFile(URL, false);
  
  /* prints the information of entries type with 'function' 
     from class URL to the console. */
  jsdump.typeEntriesPrint(URL);
  /* prints the serialized information of entries type 
     with 'function' from class URL to the console. */
  jsdump.typeEntriesPrint(URL, 'function', false);
  
  /* writes the information of entries type with 'function' 
     from class URL to txt file. */
  jsdump.typeEntriesFile(URL);
  /* writes the serialized information of entries type 
     with 'function' from class URL to txt file. */
  jsdump.typeEntriesFile(URL, 'function', false);
  
  // prints constructor source of class URL to the console.
  jsdump.sourcePrint(URL);
  // prints toString() source of class URL to the console.
  jsdump.sourcePrint(URL, 'toString');
 
  /* writes the constructor source of class URL to a txt 
     file in current directory. */
  jsdump.sourceFile(URL);
  /* writes toString() source of class URL to a txt file 
     in current directory. */
  jsdump.sourceFile(URL, 'toString');
  

To see JSDump APIs

Tests

Runs the following commands from your project.

$ cd ./node_modules/jsdump
$ npm test

Enhancing Code Playgrounds

Using JSDump with StackBlitz, CodeSandBox, JS Bin, and other code playgrounds automatically dumping out object information to the playground console.

License

MIT

Package Sidebar

Install

npm i jsdump

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

67.9 kB

Total Files

9

Last publish

Collaborators

  • rdli