npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

srvoa

v1.3.2

Published

Infrastructure for service oriented architecture.

Downloads

17

Readme

NPM

build status coverage status

srvoa - 1.3.1


srvoa is deprecated due to kermit.


  • is the infrastructure for service oriented architecture (SOA) for node.js
  • provides unified interfaces for writing modular apps and (micro-)services
  • eases and unifies the configuration of apps and its modules
  • enables dependency injection
  • is written in ES6 with ES5 compatible build using babel
  • is fully tested with mocha

Find the api docs on kermit-js.readme.io


The Doctrine

  1. An application is complex. So lets split it into functional modules (Services), each of them being way more simple and exchangeable.
  2. All Services have an unified interface configure([serviceConfig]), bootstrap(), launch().
  3. All Services are EventEmitters.
  4. The ServiceManager is the di-container of srvoa in which all services are registered.
  5. All Services have access to the ServiceManager.
  6. An Application is a Service, that manages dependent services and their configuration in the ServiceManager.
  7. An Application manages the life-cycle of its dependent services.

The Vision

  • There are many srvoa wrappers for popular node.js modules.
  • srvoa is ported to other environments / programming languages.

Install

$ npm install srvoa

Getting Started

A simple demo srvoa application may look like this:

  • config
    • application.js
    • application.local.js (excluded from vcs)
  • src
    • DemoService.js
    • Application.js
  • application.js
application.js
var Application = require('./src/Application.js'),
    app;

app = new Application;
app.configure({
    files: [
        __dirname + '/config/application.js',
        __dirname + '/config/application.production.js',
        __dirname + '/config/application.local.js'
    ]
}).bootstrap().launch();

module.exports = app;

The application can read and merge multiple config files recursively (last wins). If a config file does not exist, it is skipped silently. That makes environment specific configuration sexy.

  • Split your application and services configuration into multiple files.
  • Ignore the local config from vcs.
  • Generate production / staging etc. config files (with credentials) in the CI-Tool. Avoid having sensible data in vcs.
  • Override selected configurations in a specific environment.
config/application.js
modules.exports = {
    app: {
        services: {
          demo: require(__dirname + '/../src/DemoService')
        }
    },

    'demo-service': {
        slogan: 'Hey dude!'
    }
};

The application will manage all services defined in app.services.

config/application.local.js
modules.exports = {
    'demo-service': {
        secret: '1234'
    }
};
src/Application.js
"use strict";

var BaseApp = require('srvoa').Application;

class Application extends BaseApp {}

modules.exports = Application;
src/DemoService.js
"use strict";

var Service = require('srvoa').Service;

class DemoService extends Service {
    static get CONFIG_KEY() {
        return 'demo-service';
    }

    constructor(serviceManager) {
        super(serviceManager);

        this.slogan = null;
        this.secret = null;
    }

    configure(config) {
        this.slogan = config.slogan;
        this.secret = config.secret;

        return this;
    }

    launch() {
        console.info('slogan: ' + this.slogan);

        if (this.secret) {
            console.info('secret: ' + this.secret);
        } else {
            console.info('No secret was configured.');
        }

        return this;
    }
}

modules.exports = DemoService;

Running node application will output the following to the cli:

slogan: Hey dude!
secret: 1234

TODO

  • Move the code above into a demo application repository
  • Improve the docs
    • Examples
  • Write third party module wrappers

CHANGELOG

Please have a look at CHANGELOG.

LICENSE

The files in this archive are released under BSD-2-Clause license. You can find a copy of this license in LICENSE.


Attribution

Icon: IT Infrastructure by Emily van den Heever from the Noun Project