Package Exports
- codeai
- codeai/dist/codexjs.es5.js
- codeai/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (codeai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CodeAI
Quickly call OpenAI to generate code.
Project Description
OpenAI has created a JavaScript code generation library that makes it easier to use OpenAI's generated code and provides a foundation for higher-level software.
Browser Support
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|
| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
Platform
| UMD | CJS | ESM | Typescript |
|---|---|---|---|
| Support ✔ | Support ✔ | Support ✔ | Support ✔ |
Installing
Package manager
Using npm:
npm install codeaiYou can also use the default export, since the named export is just a re-export from the codeai factory:
import codexjs from 'codeai';
codexjs.get('实现一个数组去重函数,es6版本', (data) => {
console.log(data)
}, () => {
console.log('Information transmission complete.')
}, err => {
console.log('error:', err)
})If you use require for importing, only default export is available:
const codexjs = require('codeai');
codexjs.get('实现一个数组去重函数,es6版本', (data) => {
console.log(data)
}, () => {
console.log('Information transmission complete.')
}, err => {
console.log('error:', err)
})For cases where something went wrong when trying to import a module into a custom or legacy environment, you can try importing the module package directly:
const codexjs = require('codeai/dist/codexjs.cjs'); // browser commonJS bundleFor more information, please see the examples in the /demo files. I have prepared demonstration files in both cjs and umd formats.
CDN
Using jsDelivr CDN (ES5 UMD browser module):
<script src="https://cdn.jsdelivr.net/npm/codeai@0.0.4/dist/codexjs.umd.js"></script>Using unpkg CDN:
<script src="https://unpkg.com/codeai@0.0.4/dist/codexjs.umd.js"></script>🚧 Tip
This project is still in an unstable phase. If you encounter any issues, please feel free to open an issue on GitHub. We welcome your feedback and suggestions.





