Registry / web-framework / isomor-core

isomor-core

JSON →
library3.0.0jsnpmunverified

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.

npm install isomor-core
INSTALL
IMPORT
SIG · ISOMOR-CORE
I
isomor-core
web-frameworkjavascriptv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

isomor
import { isomor } from 'isomor-core'
const isomor = require('isomor-core')
ESM-only; CommonJS require is not supported.
IsomorOptions
import type { IsomorOptions } from 'isomor-core'
import { IsomorOptions } from 'isomor-core'
Type-only import for TypeScript users; avoid runtime errors.
handler
import { handler } from 'isomor-core'
Named export; no default export available.
setupIsomor
import { setupIsomor } from 'isomor-core'
const { setupIsomor } = require('isomor-core')
ESM-only; CJS require will fail.

Demonstrates calling a server function directly using isomor and defining a handler on the server side.

import { isomor, handler } from 'isomor-core'; const apiKey = process.env.API_KEY ?? 'default-key'; async function main() { const result = await isomor({ url: '/api/greet', method: 'POST', headers: { 'X-API-Key': apiKey }, body: { name: 'World' }, }); console.log('Result:', result); } handler({ greet: async (name: string) => `Hello, ${name}!`, }); main();
Debug
Known issues
breakingv3.0.0 removes support for Node.js versions < 11. Ensure your environment uses Node.js >= 11.
fix
Upgrade to Node.js >= 11.
affects: <3.0.0
gotchaAll exports are ESM-only; using require() will throw an error.
fix
Use import statements instead of require().
affects: >=3.0.0
deprecatedThe `isomor` default export is deprecated; use named import instead.
fix
Replace `import isomor from 'isomor-core'` with `import { isomor } from 'isomor-core'`.
affects: >=3.0.0
gotchaTypeScript type imports must use `import type` to avoid runtime side effects.
fix
Use `import type { ... } from 'isomor-core'` for type-only imports.
affects: >=3.0.0
gotchaThe `handler` export expects an object with async functions; passing synchronous functions may cause unexpected behavior.
fix
Ensure all handler methods return a Promise or use async/await.
affects: >=3.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using CommonJS require() with an ESM-only package.
fix
Switch to ES modules: use import statements or rename .js to .mjs.
TypeError: isomor is not a function
Using default import instead of named import, or using wrong import syntax.
fix
Use `import { isomor } from 'isomor-core'`.
The requested module 'isomor-core' does not provide an export named 'default'
Trying to import default export when only named exports exist.
fix
Use `import { isomor } from 'isomor-core'` instead of `import isomor from 'isomor-core'`.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
isomor-core — npm install isomor-core · libregistry