ii
import-inspector
npm i import-inspector
ii

import-inspector

Wrap dynamic imports with metadata about the import

by Jamie Kyle

2.0.0 (see all)License:MITTypeScript:Not Found
npm i import-inspector
Readme

import-inspector

Wrap dynamic imports with metadata about the import

import {inspect, report} from 'import-inspector';

const stopInspecting = inspect(metadata => {
  console.log(metadata);
});

report(import('./other-module'), { whatever: 42 });
// log: { whatever: 42 }

stopInspecting();

API

inspect(callback)

Add a callback to be called whenever the report() function is called. Receives metadata from report().

Returns a function stopInspecting() that will stop the callback from being called again.

report(promise, metadata)

Wrap an import promise with some metadata to report.

Downloads/wk

7.3K

GitHub Stars

26

LAST COMMIT

5yrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
2.0.0
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial