![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@therms/rpc-client
Advanced tools
A Remote Procedure Call framework for Javascript environments (Node.js & Browser).
npm i @therms/rpc-client
import { RPCClient } from '@therms/rpc-client'
/* Create a client instance */
const rpc = new RPCClient({
hosts: {
http: 'localhost:3995/rpc',
websocket: 'localhost:3996', // optional
},
});
/* Make a remote procedure call */
const {
code, // http status code, ie: 200
data, // any data returned from the remote/server
message, // a human readable message from the remote/server
success, // boolean, true|false if the procedure was succesful
} = await rpc.call({
// optional
args: {
email: 'me@gmail.com',
password: '1234567',
},
procedure: 'login',
// optional
scope: 'auth',
// optional
version: '1',
});
const rpc = new RPCClient({
cacheMaxAgeMs: 5 * 60 * 1000, // optional
deadlineMs: 5000, // optional
hosts: {
http: 'localhost:3995/rpc',
},
});
const rpc = new RPCClient({
hosts: {
http: 'localhost:3995/rpc',
},
requestInterceptor: (request) => {
request.args.count = request.args.count + 1;
return request;
},
});
const { data } = await rpc.call({
args: { count: 1 },
procedure: 'intercept-request',
});
console.log(data.count); // => 2
const rpc = new RPCClient({
hosts: {
http: 'localhost:3995/rpc',
},
responseInterceptor: (response) => {
response.data.count = 100;
return response;
},
});
const { data } = await rpc.call({
args: { count: 1 },
procedure: 'intercept-request',
});
console.log(data.count); // => 100
First, setup a custom Transport
:
see the required interface in
src/client/Transports/Transport.ts
class CustomHTTPTransport {
isConnected() {
return true;
}
name: 'CustomHTTPTransport';
async sendRequest(call) {
const response = await fetch('localhost:3901/rpc', {
data: call,
}).then((res) => res.json());
return response;
}
setIdentity(identity) {
this.identity = identity;
}
}
Then, use the CustomHTTPTransport
when you create a client instance:
const rpc = new RPCClient({
cacheMaxAgeMs: 5 * 60 * 1000, // optional
deadlineMs: 5000, // optional
transports: {
http: new CustomHTTPTransport(),
},
});
FAQs
RPC framework, browser client lib
The npm package @therms/rpc-client receives a total of 35 weekly downloads. As such, @therms/rpc-client popularity was classified as not popular.
We found that @therms/rpc-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.