Hi everyone, this is currently the de facto way to encode and decode strings in javascript. But I cannot import this node library in a chrome extension because it relies on the fs module:
Uncaught TypeError: fs.readFileSync is not a function
at ./node_modules/gpt-3-encoder/Encoder.js (Encoder.js:5:1)
at __webpack_require__ (bootstrap:19:1)
at ./node_modules/gpt-3-encoder/index.js (index.js:1:28)
at __webpack_require__ (bootstrap:19:1)
at make namespace object:7:1
at popup.js:22:2
at popup.js:22:2
This is problematic since a great use case for this library is to count token usage BEFORE sending text to chatgpt. Is there any way this library can be made to not rely on fs so that it can be imported in a chrome extension like setting?
Hi everyone, this is currently the de facto way to encode and decode strings in javascript. But I cannot import this node library in a chrome extension because it relies on the
fsmodule:This is problematic since a great use case for this library is to count token usage BEFORE sending text to chatgpt. Is there any way this library can be made to not rely on
fsso that it can be imported in a chrome extension like setting?