ApiPublisher is a Node.js framework for exposing asynchronous JavaScript APIs (returning Promises) over HTTP, enabling identical async function calls on client and server. Current version 2.1.5 requires Node >=10.0.0. It ships TypeScript types. Key differentiators: works seamlessly with Connect/Express, supports ES7 async/await via Nodent, offers browser RemoteApi with caching (including localStorage), and has been in production since 2013. Unlike generic RPC libraries, it preserves Promise semantics and supports nested APIs automatically.
npm install apipublisherNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Exposes an async API over HTTP using Express. Note: 'api.handle' must be passed to app.use(), not the API object itself.
Replace `app.use('/api', api)` with `app.use('/api', api.handle)`.Use `import` syntax or upgrade to Node >=12 with --experimental-modules for older versions.
Consider migrating to a library that uses native async/await and standard Promises.
Avoid property names that conflict with Promise or Object prototypes.
Use `new URL('http://example.com/api')` if passing an object, or simply a string URL.Run `npm install apipublisher` and ensure you are using ESM import syntax (e.g., `import { ApiPublisher } from 'apipublisher'`).Use `app.use('/path', api.handle)`.Wrap the code in an async function: `async function main() { ... }` or use Promises with `.then()`.Use `import { ... } from 'apipublisher'` or rename file to .cjs.No dependency data recorded yet.