🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

dpd-emitter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dpd-emitter

Emit events for every collection CRUD operation except Read

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

dpd-emitter

Emit events for collection CRUD operations on Deployd

Installation

npm install dpd-emitter --save

Events

Events created, updated and deleted are emitted when models are created, updated and deleted respectively.

Event Data

The model object operated on is always sent along with the events.

Usage

var socket = io('http://localhost:2403'); // Change the url as seen fit

// watch new models
socket.on('<resourcename>:created', function(model) {
    // do something with model
});

// watch all updated models
socket.on('<resourcename>:updated', function(model) {
    // do something with model
});

// watch updates on a particular model
socket.on('<resourcename>:updated:<id>', function(model) {
    // do something with model
});

// watch all deleted models
socket.on('<resourcename>:deleted', function(model) {
    // do something with model
});

// watch when a particular model is deleted
socket.on('<resourcename>:deleted:<id>', function(model) {
    // do something with model
});

Keywords

dpdmodule

FAQs

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