1.6.11 • Published 3 years ago

unete-io v1.6.11

Weekly downloads
147
License
ISC
Repository
-
Last release
3 years ago

Unete-IO

JS Minimalist, Flexible & Powerful microservices & api library

🚨 ALERT: Unete-IO is the socket.io library of the Unete ecosystem, if you want to mount a server, please go to unete-serve. 🚨

What's Unete-IO?

https://i.ibb.co/zSh4bQZ/UneteIO.png

Unete-IO is an RPC library that takes any vanilla Javascript (or Typescript) module and exports it to the web as a realtime API.

Installation

UneteIO is a regular JS module, install it by using:

$ npm i @unete/io

Client

Connect to a Unete-IO Server

import { Socket } from "unete-io";

// Create Connection & Initialize API
const Service = Socket("http://localhost");

async function main () {
	// Call methods as vanilla js objects
	const result = await Service.sum(1,2,3);	

	console.log(result);
}

main();

Server

Create a Unete-IO Server

import { Server } from "unete-io";

const server = new Server({
	
	sum (...nums: number[])  {
		let sum = 0;
		
		for(const num of nums) sum += num;

		return sum;
	},
	
	// Following methods are optional, only use them if you really need to hook internal operations
	
	$before_call({ path, iid, args }){}, // Before Method Execution
	$after_call({ path, iid, args, timestamp, res }){}, // Before Method Execution
	$after_error({ path, iid, error }){},
	
	$error(error: any){}, // Transform errors before being sent to the client, if you only want to hook the exceptions, use $after_error
	
})

server.listen(8080, () => console.log("Server up and running!"));

Features

  • Client Side - x Access backend methods as regular functions using Javascript reflection
  • Data Transmission - x Primitive & JSON Objects - x Support for remote Callbacks (Use Observables when possible) - x Support for remote observables (No HTTP)
1.6.11

3 years ago

1.6.10

3 years ago

1.6.9

3 years ago

1.6.8

3 years ago

1.6.7

3 years ago

1.6.6

3 years ago

1.6.5

3 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.5.7

4 years ago

1.5.6

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.0

4 years ago

1.0.1-4

4 years ago

1.0.1-3

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago