sidorares / json-bigint

JSON.parse/stringify with bigints support
MIT License
790 stars 189 forks source link

How to use with es6 import? #79

Closed mittster closed 2 years ago

mittster commented 2 years ago

In CommonJS I'd do:

var JSONbigNative = require('json-bigint')({ useNativeBigInt: true });

What is the ES6 syntax equivalent? This is not working:

import  * as JSONBigIntWrapper from 'json-bigint';
const JSONBigInt = JSONBigIntWrapper({useNativeBigInt: true});

as it complains that JSONBigIntWrapper is not a function.