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

@octopod-service/notifier

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octopod-service/notifier

[![npm Version](https://img.shields.io/npm/v/@octopod-service/notifier.svg)](https://www.npmjs.com/package/@octopod-service/notifier)

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Notifier for octopod

npm Version

Allow to keep virtual the resource tree while storing the content of the files in files of a folder. It encrypts the content of the files.

It is more suited for large contents than the VirtualFileSystem.

Install

npm install @octopod-service/notifier

Usage

// TypeScript
import * as notifier from '@octopod-service/notifier'
// JavaScript
const notifier = require('@octopod-service/notifier');

const notifierService = new notifier.NotifierService('http://...');

// Set option
notifierService.operations.push({
    type: 'write-file',
    settings: {
        path: '...'
    }
});

notifierService.types['write-file'] = function(type /* : DestinationType*/, data /* : Notification*/, callback /* : () => void*/)
{
    if(!type.settings.path)
    {
        this.error('Error in "write-file"', 'type.settings.path is not defined');
        return callback();
    }

    const retry = () => {
        require('fs').writeFile(type.settings.path, JSON.stringify(data), (e) => {
            if(!e)
                return callback(); // Success!

            this.error('Error in "write-file"', e);
            return setTimetout(() => retry(), type.retryTimeout ? type.retryTimeout : 10000); // If failed, retry later
        })
    }

    retry();
}

notifierService.start();

FAQs

Package last updated on 31 Jul 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

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