// ESM
import jsQR from 'jsqr'
jsQR.default(/* … */)
However, this doesn’t match the instructions from the readme.
This issue has become more apparent since the introduction of the "module": "node16" option in TypeScript 4.7. The correct way to type module.exports = is export =.
People can still use default imports when compiling to CJS. This requires them to use the esModuleInterop option (which they need anyway if they want to use it with other libraries).
According to the type definitions, this library had to be used like this:
However, this doesn’t match the instructions from the readme.
This issue has become more apparent since the introduction of the
"module": "node16"
option in TypeScript 4.7. The correct way to typemodule.exports =
isexport =
.People can still use default imports when compiling to CJS. This requires them to use the
esModuleInterop
option (which they need anyway if they want to use it with other libraries).