0.1.0 • Published 8 years ago

jk-debug v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

JK-Debug

A pithy debugging helper that can define middlewares to fit your dev flavor.

Installation

$ npm i jk-debug

Usage

To see how to use the helper, check the example.js.

If you are interested in the middleware implementation, ref to js-middleware.

API

Env Util

  • debugDetector(isDebug) -> boolean - Enable debugging mode via query string debug or env variable DEBUG.

Base Class

  • new DebugWrapper(options) -> debugInstance - Create and return a debugInstance.

Options Parameter Table:

ParameterTypeRequired?Description
isDebugbooleanoptionalBy default debugging is enabled
middlewareObjectobjectoptionalApply the middleware object to the current context

Instance Methods

  • isDebugEnabled() -> boolean - Determine the debug runtime env.

  • switchDebuggingMode(isDebug) - Enable/Disable the debugging mode.

  • log(message, ...arg) - Like console.log, but flexible and composable.

  • error(messageOrOptions, ...arg) - Ditto, but support for detailed options.

  • getTimingResults() -> ParsedTiming - Monitor the performance of page load/render.

License

MIT

0.1.0

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago