Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sigodenjs/dee-srv-create

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sigodenjs/dee-srv-create - npm Package Compare versions

Comparing version 0.17.1 to 0.18.1

10

dist/index.d.ts

@@ -1,2 +0,2 @@

import { SrvContext, InitFn, Ctor, Stop } from "@sigodenjs/dee-srv";
import { SrvContext, InitFn, Ctor } from "@sigodenjs/dee-srv";
export declare type ServiceOptionMap = {

@@ -11,9 +11,5 @@ [k: string]: ServiceOption<any, any, any>;

}
export interface CreateSrvOutput<T> {
srv: T;
stop: Stop;
}
export declare function createSrvs(ctx: SrvContext, services?: ServiceOptionMap): Promise<Stop[]>;
export declare function createSrv<T, U>(ctx: SrvContext, srvName: string, options: ServiceOption<T, U>): Promise<CreateSrvOutput<T>>;
export declare function createSrvs(ctx: SrvContext, services?: ServiceOptionMap): Promise<void>;
export declare function createSrv<T, U>(ctx: SrvContext, srvName: string, options: ServiceOption<T, U>): Promise<T>;
export declare class ServiceCreateError extends Error {
}

@@ -12,2 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const dee_srv_1 = require("@sigodenjs/dee-srv");
const createDebug = require("debug");

@@ -19,3 +20,3 @@ const events_1 = require("events");

const event = new events_1.EventEmitter();
const stops = yield Promise.all(Object.keys(services).map(srvName => {
yield Promise.all(Object.keys(services).map(srvName => {
const options = services[srvName];

@@ -28,5 +29,5 @@ let deps = options.deps || [];

createSrv(ctx, srvName, options)
.then(o => {
.then(() => {
event.emit("ready", srvName);
resolve(o.stop);
resolve();
}).catch(err => {

@@ -62,3 +63,2 @@ event.emit("error", err);

event.removeAllListeners();
return stops;
});

@@ -88,6 +88,9 @@ }

}
const { srv, stop = (() => { }) } = yield init(ctx, options.args, options.ctor, deps);
const srv = yield init(ctx, options.args, options.ctor, deps);
if (srv[dee_srv_1.INIT_KEY]) {
yield srv[dee_srv_1.INIT_KEY]();
}
debug(`finish starting srv ${srvName}`);
ctx.srvs[srvName] = srv;
return { srv, stop };
return srv;
}

@@ -94,0 +97,0 @@ catch (err) {

{
"name": "@sigodenjs/dee-srv-create",
"version": "0.17.1",
"version": "0.18.1",
"description": "Utils for creating batch of dee-srvs",

@@ -30,3 +30,3 @@ "main": "dist/index.js",

"dependencies": {
"@sigodenjs/dee-srv": "^0.17.0"
"@sigodenjs/dee-srv": "^0.18.0"
},

@@ -33,0 +33,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc