New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

zajil-express-rpc

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zajil-express-rpc

make backend data types and functions accessible from frontend

latest
npmnpm
Version
0.0.4
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Zajil RPC (WIP)

make backend data types and functions accessible from frontend.

No need to make complicated REST APIs just to call the backend function you want to call using REST API.

Type-safe communication channel and forces javascript to use safe integers for better accuracy.

TODO:

  • Client library
  • Authentication

How to use


import express from 'express';
import { Zajil , int , string , float } from "./rpc.js";


// class templates to be shared with frontend
class response {
    status = int;
    msg = string;
    data = {
        name : string,
        age: int
    }
}

// rpc confugration
let rpc = new Zajil( "rpc_v1" );


rpc.return( response )
rpc.params( string , int , string , float )
rpc.function (
    function register( name , age , subject , grade ) {
        
        // write code to register user <<<<

        const resp = new response;
        resp.status = 201;
        resp.msg = "created"

        return resp
    }
)


rpc.return( response )
rpc.params( string , int , string , float )
rpc.function ( 
    function some_other_stuffs( name , age , subject , grade ) {
        
        // write code to register user <<<<

        const resp = new response;
        resp.status = 201;
        resp.msg = "created"

        return resp
    }
)


const app = express()

// connecting rpc to express.js
rpc.linkApp(app);

app.listen(8080);

Author

By Hussein Layth Al-Madhachi

Keywords

zajil

FAQs

Package last updated on 18 May 2025

Did you know?

Socket

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.

Install

Related posts