
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
angular-pub-sub
Advanced tools
An Angular module that implements a Publish Subscribe service with support for message history.
Straightforward Publish-Subscribe module for AngularJS. Supports messages with multiple parameters and supports keeping a message history and rewinding upon subscription.
This README and plenty of JSDOC comments if you feel like messing around with the code. Feel free to reach out here or on twitter (@jmnsferreira) if anything's unclear.
angular-pub-sub.js (or the -min version);npm install angular-pub-sub...
var myApp = angular.module('myApp', ['PubSubModule']);
...
Set the maximum number of messages to store in the history for playback upon subscription. Default is 10.
app.config(['pubSubProvider', function(pubSubProvider) {
pubSubProvider.setMaxHistory(5);
}]);
publishPublish a message to a channel.
Args:
channel - A String that identifies a channel (can be a new channel).message* - Any number of arguments, can be zero for a simple "ping", of any data type to pass onto subscribers.Return: undefined
Example:
myApp.controller('ItemsCtrl', function($scope, pubSub) {
var nextPage = function () {
...
pubSub.publish('nav-analytics', 'items', $scope.currentPage);
...
};
});
subscribeSubscribe to a channel to receive future messages and, optionally, previous ones.
Args:
channel - A String that identifies a channel. Same string as used in publish.callback - A Function that will be executed with each message that is published on the selected channel.playback - (Optional) When true, messages previously published on channel will be played back (applied on callback). Doesn't playback by default.maxPlayback - (Optional) An Integer; the maximum number of messages to play back. Default is all available.Return: A Function that will unsubscribe from channel when called.
Example:
myApp.controller('AnalyticsCtrl', function($scope, pubSub) {
var killAnalytics = null;
var trackPageView = function (name, page) {
_analytics.track(name, page);
};
var setUp = function () {
...
killAnalytics = pubSub.subscribe('nav-analytics', trackPageView, true, 1);
...
};
var setDown = function () { killAnalytics(); };
});
Clone the project:
$ git clone https://github.com/<your-repo>/angular-pub-sub.git
$ cd angular-pub-sub
$ npm install
$ bower install
Run the tests:
$ grunt test
$ grunt dist
FAQs
An Angular module that implements a Publish Subscribe service with support for message history.
The npm package angular-pub-sub receives a total of 2 weekly downloads. As such, angular-pub-sub popularity was classified as not popular.
We found that angular-pub-sub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.