{"id":25765,"library":"isomor-core","title":"Isomor Core","description":"Core library for isomor, a tool that abstracts frontend-backend communication in web applications by allowing direct server function calls from UI code without REST or GraphQL. Version 3.0.0 is current; the project uses a rolling release cadence. Key differentiators include automatic layer generation via Babel transpilation, tight code coupling, and TypeScript consistency. Isomor eliminates boilerplate and reduces overhead by keeping all code in a single project. The core package provides essential utilities and types.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/apiel/isomor","tags":["javascript","typescript"],"install":[{"cmd":"npm install isomor-core","lang":"bash","label":"npm"},{"cmd":"yarn add isomor-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add isomor-core","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require is not supported.","wrong":"const isomor = require('isomor-core')","symbol":"isomor","correct":"import { isomor } from 'isomor-core'"},{"note":"Type-only import for TypeScript users; avoid runtime errors.","wrong":"import { IsomorOptions } from 'isomor-core'","symbol":"IsomorOptions","correct":"import type { IsomorOptions } from 'isomor-core'"},{"note":"Named export; no default export available.","wrong":"","symbol":"handler","correct":"import { handler } from 'isomor-core'"},{"note":"ESM-only; CJS require will fail.","wrong":"const { setupIsomor } = require('isomor-core')","symbol":"setupIsomor","correct":"import { setupIsomor } from 'isomor-core'"}],"quickstart":{"code":"import { isomor, handler } from 'isomor-core';\n\nconst apiKey = process.env.API_KEY ?? 'default-key';\n\nasync function main() {\n  const result = await isomor({\n    url: '/api/greet',\n    method: 'POST',\n    headers: { 'X-API-Key': apiKey },\n    body: { name: 'World' },\n  });\n  console.log('Result:', result);\n}\n\nhandler({\n  greet: async (name: string) => `Hello, ${name}!`,\n});\n\nmain();","lang":"typescript","description":"Demonstrates calling a server function directly using isomor and defining a handler on the server side."},"warnings":[{"fix":"Upgrade to Node.js >= 11.","message":"v3.0.0 removes support for Node.js versions < 11. Ensure your environment uses Node.js >= 11.","severity":"breaking","affected_versions":"<3.0.0"},{"fix":"Use import statements instead of require().","message":"All exports are ESM-only; using require() will throw an error.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Replace `import isomor from 'isomor-core'` with `import { isomor } from 'isomor-core'`.","message":"The `isomor` default export is deprecated; use named import instead.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Use `import type { ... } from 'isomor-core'` for type-only imports.","message":"TypeScript type imports must use `import type` to avoid runtime side effects.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Ensure all handler methods return a Promise or use async/await.","message":"The `handler` export expects an object with async functions; passing synchronous functions may cause unexpected behavior.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Switch to ES modules: use import statements or rename .js to .mjs.","cause":"Using CommonJS require() with an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Use `import { isomor } from 'isomor-core'`.","cause":"Using default import instead of named import, or using wrong import syntax.","error":"TypeError: isomor is not a function"},{"fix":"Use `import { isomor } from 'isomor-core'` instead of `import isomor from 'isomor-core'`.","cause":"Trying to import default export when only named exports exist.","error":"The requested module 'isomor-core' does not provide an export named 'default'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}