local-rpc

Proxy-based local-rpc (aka runtime dependency injection)

Usage no npm install needed!

<script type="module">
  import localRpc from 'https://cdn.skypack.dev/local-rpc';
</script>

README

local-rpc

Proxy-based local-rpc (aka runtime dependency injection)

// Consumer API
const { componentA, componentB } = require('local-rpc');

componentA.firstOperation(1, 2, 3);
componentB.subComponentX.finalOperation(4, 5, 6);

// Profit
// Provider API
require('local-rpc')((...args) => console.log(...args));

// Profit

install

with npm do:

npm install local-rpc

license

MIT