TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ollm/opencomic-ai-models/llms.txt
Use this file to discover all available pages before exploring further.
opencomic-ai-models package ships both an ESM build (dist/index.mjs) and a CommonJS build (dist/index.cjs), alongside a TypeScript declaration file (dist/index.d.ts). Node.js automatically selects the correct build based on your project’s module system, so the package works in any modern Node.js project without extra configuration.
Importing the package
- ESM
- CJS
- TypeScript
To use the ESM
import syntax in a Node.js project, add "type": "module" to your package.json, or rename your file to use the .mjs extension. CJS require works without any extra settings in standard Node.js projects.TypeScript declaration
The package exports a single default object. The TypeScript declaration mirrors the runtime shape exactly:path is always typed as string — it is a fully resolved absolute path computed at module load time.
Package exports field
Thepackage.json exports field tells Node.js (and bundlers) which build to load for each module system:
import OpenComicAIModels from 'opencomic-ai-models', Node.js resolves to dist/index.mjs. When you write require('opencomic-ai-models'), it resolves to dist/index.cjs. TypeScript reads dist/index.d.ts for type information in both cases.
Resolving the path at runtime
Thepath value is computed once when the module is first loaded, using Node.js’s built-in path.join:
node_modules/opencomic-ai-models/dist/, it always points to the correct models/ directory regardless of your project’s working directory or how you invoke the process. You do not need to construct or hard-code the path yourself.