You can convert a JavaScript string to a bigint value by using the BigInt() wrapper object, for example, like so:
// ES10+
const numericStr = '9007199254740991123456789';
const bigIntVal = BigInt(numericStr);
console.log(bigIntVal); // 9007199254740991123456789n
The "n" at the end of a number merely suggests that the number is a bigint primitive.