nodejs / import-in-the-middle

Like `require-in-the-middle`, but for ESM import
https://www.npmjs.com/package/import-in-the-middle
Apache License 2.0
60 stars 22 forks source link

Add specifier parameter on addHook #19

Closed uurien closed 2 years ago

uurien commented 2 years ago

What does this PR do?

Adds an extra parameter to addHook callbacks with the specifier information

Motivation

Is a userful information to know if we talking about a file or about one module, it is not the same:

import something from './my-file.mjs'

or

import something from 'module-name'