Skip to content

List of internal LMD events

azproduction edited this page Jan 28, 2013 · 1 revision

*:before-check

before module cache check

  • {String} moduleName
  • {Object} module
  • {String} type

Listener returns context: no

*:before-init

calls when module is goint to eval or call

  • {String} moduleName
  • {Object} module

Listener returns context: no

*:coverage-apply

applies code coverage for module

  • {String} moduleName
  • {Object} module

Listener returns context: yes

*:create-promise

creates promise

no

Listener returns context: no

*:is-plain-module

code type check request: plain or lmd-module

  • {String} moduleName
  • {String} module
  • {String} isPlainCode default value

Listener returns context: yes

*:request-error

module load error

  • {String} moduleName
  • {Object} module

Listener returns context: no

*:request-indexof

requests indexOf polifill

  • {Function|undefined} arrayIndexOf default indexOf value

Listener returns context: yes

*:request-json

requests JSON polifill with only stringify function!

  • {Object|undefined} JSON default JSON value

Listener returns context: yes

*:request-off-package

  • {String} moduleName
  • {Function} callback
  • {String} type

Listener returns context: yes [asap, returnResult]

*:request-parallel

parallel module request for require.async(['a', 'b', 'c']) etc

  • {Array} moduleNames list of modules to init
  • {Function} callback this callback will be called when module inited
  • {Function} method method to call for init

Listener returns context: yes empty environment

*:request-race

race module request eg for cases when some async modules are required simultaneously

  • {String} moduleName race for module name
  • {Function} callback this callback will be called when module inited

Listener returns context: yes returns callback if race is empty or only 1 item in it

*:rewrite-shortcut

fires before stats plugin counts require same as *:rewrite-shortcut but without triggering shortcuts:before-resolve event

  • {String} moduleName race for module name
  • {String} module this callback will be called when module inited

Listener returns context: yes returns modified moduleName and module itself

*:rewrite-shortcut

request for shortcut rewrite

  • {String} moduleName race for module name
  • {String} module this callback will be called when module inited

Listener returns context: yes returns modified moduleName and module itself

*:stats-coverage

adds module parameters for statistics

  • {String} moduleName
  • {Object} moduleOption preprocessed data for lines, conditions and functions

Listener returns context: no

*:stats-get

somethins is request raw module stats

  • {String} moduleName
  • {Object} result default stats

Listener returns context: yes

*:stats-results

somethins is request processed module stats

  • {String} moduleName
  • {Object} result default stats

Listener returns context: yes

*:stats-type

something tells stats to overwrite module type

  • {String} moduleName
  • {String} packageType

Listener returns context: no

*:wrap-module

Module wrap request

  • {String} moduleName
  • {String} module this module will be wrapped
  • {String} contentTypeOrExtension file content type or extension to avoid wrapping json file

Listener returns context: yes

async:before-callback

when async.js require is going to return module, uses for cache async module

  • {String} moduleName
  • {String} module module content

Listener returns context: no

async:require-environment-file

requests file register using some environment functions non XHR

  • {String} moduleName
  • {String} module
  • {Function} callback this callback will be called when module inited

Listener returns context: no

js:request-environment-module

js.js plugin requests for enviroment-based module init (importScripts or node require)

  • {String} moduleName
  • {String} module

Listener returns context: yes

lmd-register:after-register

after module register event

  • {String} moduleName
  • {Object} module

Listener returns context: no

lmd-register:before-register

before module register event

  • {String} moduleName
  • {Object} module

Listener returns context: no

lmd-register:decorate-require

request for fake require

  • {String} moduleName
  • {Object} module

Listener returns context: yes wraps require

shortcuts:before-resolve

moduleName is shortcut and its goint to resolve with actual name

  • {String} moduleName
  • {Object} module

Listener returns context: no

stats:before-return-stats

stats is going to return stats data this event can modify that data

  • {String|undefined} moduleName
  • {Object} stats_results default stats

Listener returns context: yes depend on moduleName value returns empty array or replaces stats_results