
Research
/Security News
Laravel Lang Compromised with RCE Backdoor Across 700+ Versions
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.
@devgrid/netron
Advanced tools
A powerful TypeScript library for building distributed systems with event bus, streams, and remote object invocation capabilities. Built with WebSocket for real-time bidirectional communication between Node.js and browser environments.
npm install @devgrid/netron
# or
yarn add @devgrid/netron
import { Netron, Service, Public } from '@devgrid/netron';
@Service('calculator@1.0.0')
class Calculator {
@Public()
add(a: number, b: number): number {
return a + b;
}
@Public()
multiply(a: number, b: number): number {
return a * b;
}
@Public({ readonly: true })
version: string = '1.0.0';
}
const server = await Netron.create({
listenHost: 'localhost',
listenPort: 8080,
taskTimeout: 5000,
connectTimeout: 5000,
requestTimeout: 5000,
streamTimeout: 5000,
allowServiceEvents: true,
maxReconnectAttempts: 5
});
// Expose the calculator service
await server.peer.exposeService(new Calculator());
import { Netron } from '@devgrid/netron';
const client = await Netron.create();
const remotePeer = await client.connect('ws://localhost:8080');
// Query the calculator interface
const calculator = await remotePeer.queryInterface<ICalculator>('calculator@1.0.0');
// or latest version
const latestCalculator = await peer.queryInterface<ICalculator>('calculator');
// Use remote methods
const sum = await calculator.add(5, 3); // 8
const product = await calculator.multiply(4, 2); // 8
const version = await calculator.version; // '1.0.0'
// Server side
@Service('notifications')
class NotificationService {
@Public()
async broadcast(message: string) {
await this.netron.emitParallel('notification', { message });
}
}
// Client side
remotePeer.subscribe('notification', (data) => {
console.log('New notification:', data.message);
});
// Different emission patterns
await netron.emitParallel('event'); // Execute handlers in parallel
await netron.emitSerial('event'); // Execute handlers sequentially
await netron.emitReduce('event'); // Reduce pattern (left to right)
await netron.emitReduceRight('event'); // Reduce pattern (right to left)
@Service('fileService')
class FileService {
@Public()
async streamFile(filename: string) {
const stream = createReadStream(filename);
return new ReadableStream(stream);
}
@Public()
async uploadFile(filename: string) {
const stream = createWriteStream(filename);
return new WritableStream(stream);
}
}
// Client usage
const fileService = await remotePeer.queryInterface('fileService');
const readStream = await fileService.streamFile('large.file');
for await (const chunk of readStream) {
console.log('Received chunk:', chunk);
}
// Define a task
netron.addTask(async function pingTask(peer) {
return { status: 'ok', timestamp: Date.now() };
});
// Execute task on remote peer
const result = await remotePeer.runTask('pingTask');
@Service('users')
class UserService {
@Public()
async getUser(id: number): Promise<User> {
return this.database.findUser(id);
}
@Public({ readonly: true })
currentUser: User;
// Private methods/properties are not exposed
private async validateUser(user: User) {
// ...
}
}
interface NetronOptions {
id?: string; // Unique identifier for the Netron instance
listenHost?: string; // Host to listen on (server only)
listenPort?: number; // Port to listen on (server only)
taskTimeout?: number; // Timeout for task execution (default: 5000ms)
taskOverwriteStrategy?: 'replace' | 'skip' | 'throw'; // How to handle duplicate tasks
connectTimeout?: number; // Connection timeout (default: 5000ms)
requestTimeout?: number; // Request timeout (default: 5000ms)
streamTimeout?: number; // Stream timeout (default: 5000ms)
allowServiceEvents?: boolean; // Enable service events
maxReconnectAttempts?: number; // Maximum reconnection attempts (default: unlimited)
}
class Netron {
static create(options?: NetronOptions): Promise<Netron>;
connect(address: string): Promise<RemotePeer>;
disconnect(peerId: string): void;
addTask(fn: Task): string;
getServiceNames(): string[];
emitParallel(event: string, ...args: any[]): Promise<void>;
emitSerial(event: string, ...args: any[]): Promise<void>;
emitReduce(event: string, ...args: any[]): Promise<any>;
emitReduceRight(event: string, ...args: any[]): Promise<any>;
}
interface ServiceMetadata {
name: string;
version: string;
properties: Record<string, PropertyInfo>;
methods: Record<string, MethodInfo>;
}
interface PropertyInfo {
type: string;
readonly: boolean;
}
interface MethodInfo {
type: string;
arguments: ArgumentInfo[];
}
interface ArgumentInfo {
index: number;
type: string;
}
class RemotePeer {
queryInterface<T>(qualifiedName: string): Promise<T>;
queryInterfaceByDefId<T>(defId: string, def?: Definition): T;
subscribe(eventName: string, handler: EventSubscriber): Promise<void>;
unsubscribe(eventName: string, handler: EventSubscriber): Promise<void>;
runTask(name: string, ...args: any[]): Promise<any>;
disconnect(): void;
getServiceNames(): string[];
}
MIT
Built with:
FAQs
A powerful TypeScript library for building distributed systems with event bus, streaming capabilities, and remote object invocation. Features WebSocket-based bidirectional communication between Node.js and browser environments, service discovery, and type
The npm package @devgrid/netron receives a total of 44 weekly downloads. As such, @devgrid/netron popularity was classified as not popular.
We found that @devgrid/netron demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Research
/Security News
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.

Security News
Socket found a malicious postinstall hook across 700+ GitHub repos, including PHP packages on Packagist and Node.js project repositories.

Security News
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain