scope-reporter v4.0.5
scope-reporter
traks scope identifiers during processing
API
Table of Contents
- createScopeDefinitions
- createScopeDefinition
- commonScopes
- createConsoleAdapter
- createLoggingAdapter
- createReporter
- rootObject
- scopeDefinitions
- scopeStack
- currentScope
createScopeDefinitions
Creates several scope definition from a given json hash.
Parameters
scopesObject
createScopeDefinition
Creates a scope definition
Parameters
namestring the scope definition namepropertiesObject describung properties for the scopeformatformat string for the scope properties
commonScopes
Commonly used scopes
createConsoleAdapter
Creates a reporting adaptor for console api.
Parameters
aConsoleObject console object may be undefined for the default console (optional, defaultconsole)
Returns any the newly created adaptor
createLoggingAdapter
Creates a reporting adaptor for logging api.
Parameters
loggertarget logger
Returns any the newly created adaptor
createReporter
Creates a new scope reporter.
Parameters
scopeDefinitionsRawObjectreportAdapter
Returns ScopeReporter newly created scope reporter
rootObject
methods of all scopes
toJSON
Delivers the json representation of the scope-reporter.
Returns Object with scopes array
addScopeDefinitions
Add additional scope definitions
Parameters
defsnew scope defintions to be added to the already present ones
scope
Deliver a scope for a given scope name.
Parameters
namestring name of the scope
Returns Object for the given name
enterScope
Enter a new scope by pushing the scope to the scope stack.
Parameters
scopename of the scope to be enteredpropertiesOrScalarthe properties of the new scope may ge a scalar if there is only one possible property
Returns any newly created scope with the assigned properties.
leaveScope
Leaves the last entered scope.
Parameters
expectedScopethe expected current scope may be undefined
- Throws any if expectedScope is not the current scope
Returns any the old leaved scope
clearScopes
Clears the scope stack
scopeDefinitions
Delivers the scope definitions
Returns any scope defintions
scopeStack
Delivers the scope stack.
Returns any scope stack
currentScope
Delivers the current scope
Returns any the current scope
install
With npm do:
npm install scope-reporterlicense
BSD-2-Clause
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
