npm.io
12.0.1 • Published yesterday

@vsaas/remoting

Licence
Artistic-2.0
Version
12.0.1
Deps
11
Size
435 kB
Vulns
0
Weekly
0

@vsaas/remoting

@vsaas/remoting is a fork of strong-remoting focused on keeping LoopBack 3 style remoting working while reducing maintenance overhead.

The goal of this fork is compatibility for the common upstream use cases, not byte-for-byte preservation of the original package. The internals were intentionally simplified and modernized:

  • TypeScript source with build output in dist/
  • internal phases implementation instead of the old external loopback-phase package
  • @vsaas/error-handler instead of the upstream error handler package
  • legacy i18n and strong-globalize usage removed
  • several old dependencies removed or replaced
  • modern tooling with tsdown, vitest, and oxlint

Installation

npm install @vsaas/remoting

For end-to-end examples covering models, remote methods, ACL-aware request options, and LoopBack filters, see the application guide.

Quick start

const remoting = require('@vsaas/remoting');
const SharedClass = remoting.SharedClass;
const remotes = remoting.create();

class User {}

User.greet = async function () {
  return 'hello, world!';
};

const userSharedClass = new SharedClass('user', User);

userSharedClass.defineMethod('greet', {
  isStatic: true,
  returns: [{ arg: 'msg', type: 'string' }],
});

require('http').createServer(remotes.handler('rest')).listen(3000);

Then:

curl http://localhost:3000/user/greet

Scope

This package still provides the same main building blocks that existing strong-remoting users expect:

  • remote object collections
  • REST adapter support
  • hooks
  • stream support
  • transport abstraction

If you are migrating an existing codebase, the intent is that the public API should feel familiar even though the implementation is leaner.

Notes for fork users

  • This is a maintained fork, not the upstream package.
  • The fork is backend-only. The old browser REST adapter is intentionally not supported.
  • RemoteObjects.connect() / invoke() remain supported for service-to-service usage in Node.js.
  • Public package entry points are intentionally narrow: use @vsaas/remoting, @vsaas/remoting/phases, or @vsaas/remoting/ext/meta.
  • If you are also using the related forks, prefer pairing it with @vsaas/error-handler.
  • Some legacy internals were removed specifically to keep the codebase smaller and easier to reason about.

Development

npm run build
npm run typecheck
npm run lint
npm test

License

Artistic-2.0. See LICENSE.md.

Keywords