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

process-custodian

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

process-custodian - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

dist/lib/ProcessCustodian.js

18

dist/index.js

@@ -6,11 +6,21 @@ 'use strict';

});
exports.humanize = exports.getFingerprint = exports.init = undefined;
exports.humanize = exports.getFingerprint = exports.ProcessCustodian = undefined;
var _fingerprint = require('./lib/fingerprint');
var _mongoStorage = require('./lib/mongoStorage');
var _ProcessCustodian = require('./lib/ProcessCustodian');
exports.init = _mongoStorage.init;
var _ProcessCustodian2 = _interopRequireDefault(_ProcessCustodian);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.ProcessCustodian = _ProcessCustodian2.default;
exports.getFingerprint = _fingerprint.getFingerprint;
exports.humanize = _fingerprint.humanize;
exports.default = _mongoStorage.init;
_ProcessCustodian2.default.ProcessCustodian = _ProcessCustodian2.default;
_ProcessCustodian2.default.getFingerprint = _fingerprint.getFingerprint;
_ProcessCustodian2.default.humanize = _fingerprint.humanize;
exports.default = _ProcessCustodian2.default;
{
"name": "process-custodian",
"version": "0.1.2",
"version": "0.2.0",
"description": "This package helps with organizing of tasks between few instances of same app, It can identify processes and track them activity.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,3 +18,3 @@ # Process Custodian

After running `init` function, this package saves a heartbeat of process
After create new instance of `ProcessCustodian`, this package saves a heartbeat of process
to the passed raw mongodb collection with frequency about `tickTimeInSeconds` (which default is 60s)

@@ -29,3 +29,3 @@

```#js
import init from 'process-custodian';
import ProcessCustodian from 'process-custodian';
import {MongoClient} from 'mongodb'

@@ -38,5 +38,5 @@

const handle = init({rawCollection: collection, tickTimeInSeconds: 60});
const handle = new ProcessCustodian({rawCollection: collection, tickTimeInSeconds: 60});
handle.onTick(() => {
const stopOnTick = handle.onTick(() => {
console.log('tick', handle.isMaster() ? 'master': 'slave')

@@ -58,7 +58,7 @@ });

```#js
import init from 'process-custodian';
import ProcessCustodian from 'process-custodian';
// for meteor:
const collection = new Mongo.Collection('process_custodian');
const handle = init({
const handle = new ProcessCustodian({
rawCollection: collection.rawCollection(),

@@ -68,5 +68,5 @@ tickTimeInSeconds: 60

handle.onTick(() => {
handle.onceTick(() => {
console.log('tick', handle.isMaster() ? 'master': 'slave')
});
});

@@ -89,3 +89,3 @@ handle.onIAmNewMaster(() => {

```
import init, {getFingerprint, humanize} from 'process-custodian';
import {getFingerprint, humanize} from 'process-custodian';

@@ -92,0 +92,0 @@ //Getting fingerprint

import {getFingerprint, humanize} from './lib/fingerprint';
import {init} from './lib/mongoStorage';
import ProcessCustodian from './lib/ProcessCustodian';
export {
init,
ProcessCustodian,
getFingerprint,

@@ -11,2 +11,6 @@ humanize

export default init;
ProcessCustodian.ProcessCustodian = ProcessCustodian;
ProcessCustodian.getFingerprint = getFingerprint;
ProcessCustodian.humanize = humanize;
export default ProcessCustodian;
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