0.0.7 • Published 7 years ago

get-globals v0.0.7

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

get-globals

Easily find all available global variables in document. No guessing. No manually filtering through Object.keys(window).

Problem to solve

Imagine you are joining big front-end project and you want to see all global variables available for you. Some options you have: 1. guess names by typing them in console via dev tools 2. call Objec.keys(window).forEach(key => console.log(key)) and match output against values from ECMAScript specification and those non-standard provided by various browser vendor 3. grab this package and call global.printGlobals() and just look at output

(And yea - I suggest you to go with #3.)

get-globals at work

Installation

Install using npm:

npm install get-globals

Example

import globals from 'get-globals';

window.sampleVariable;
window.anotherVariable = true;

// assign output to variable
const availableGlobals = globals.getGlobals();
// availableGlobals = ['sampleVariable', 'anotherVariable'];


// ...or just log global variables 
global.printGlobals();
// prints: Available global variables: sampleVariable, anotherVariable.

Support for node.js

Planed. Stay tuned.

API

globals.getGlobals()

Returns all available global variables.

globals.printGlobals()

Logs all available global variables using console.log.

Support

If you have any problem or suggestion please open an issue here.

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago