champollion.parser.js_module

champollion.parser.js_module.fetch_environment(file_id, files=None, module_names=None)[source]

Return module environment dictionary from file_id.

file_id represent the identifier of the file.

files is an optional list of the other file names stored in the same directory as the one analyzed.

module_names is an optional list of all the other module name previously fetched to help determine the module name of the current file.

The environment is in the form of:

{
    "id": "module.test",
    "name": test,
    "file_id": "module/test/index.js"
}