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

micromice

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromice

A lightweight framework for micro services in node js

latest
Source
npmnpm
Version
0.0.24
Version published
Weekly downloads
2
-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

MicroMice

A lightweight framework for micro services in node js.

Code Example

const MicroMice = require('micromice');

class SomeService extends MicroMice {
  constructor() {
    super({id: 'world'});
  }

  services() {
    return {
      someOtherService: true
    }
  }

  events() {
    return {
      test: this.test
    }
  }

  start() {
    console.log('service is up');
  }

  test() {
    this.someOtherService.emit('othertest', {someData:42});
    
    console.log('test event received');
  }
}

module.exports = new SomeService();

Motivation

Installation

npm init
npm install micromice --save

API Reference

constructor

in the constractor after extending micromice you should use super with configuration of the node-ipc config currently only support unix/windows sockets

events method

this method contains a map of the events that will be listened by micromice. all the methods are bind to the microservice. the events follow the rules of node-ipc events

services method

this method map all the methods that this service connect to. the true in the value will be replaced later on with connection details once TCP/TLS will be supported. the service in the method will be bind to the microservice object.

start method

this method will be executed once the service is up.

Tests

not yet implemented

Contributors

tasks

  • tests

License

MIT license

Keywords

microservices

FAQs

Package last updated on 23 Apr 2017

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