Closed erturkdotgg closed 1 year ago
This is not a feature request but instead a question.
@EvanZhouDev perhaps we can set up GitHub discussions for questions. Or our own SO tag
To answer your question
Prerequisites
- [x] I am using the latest version of bard-ai
- [x] I have searched the issues and believe that it has not already been requested (and possibly rejected)
- [x] I agree to follow the Code of Conduct
Feature description
Is it possible to use this module with CommonJS & ES5?
This is a generic JavaScript question. Try searching up “javascript use es6 modules in commonjs”
A quick search finds this SO post that mentions using the dynamic import
function. So in your CommonJS code.
import('bard-ai').then(async ({default: Bard}) => {
const myBard = new Bard(COOKIE);
console.log(await myBard.ask("Hello, world!"));
})
Yes, Dynamic Imports.
Prerequisites
Feature description
Is it possible to use this module with CommonJS & ES5?