Utilizing https://www.npmjs.com/package/json-bigint with native BigInt functionality has been a challenge. In the CommonJS environment, the following code is typically used:
var JSONbigNative = require('json-bigint')({ useNativeBigInt: true });
I am curious about the equivalent ES6 syntax for achieving this functionality. The following approach does not seem to work:
import * as JSONBigIntWrapper from 'json-bigint';
const JSONBigInt = JSONBigIntWrapper({useNativeBigInt: true});
This results in an error message stating that JSONBigIntWrapper is not a function.
What are the general guidelines for converting import statements when rewriting code?