npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

defcon

v0.2.1

Published

A container for DEFCON modules

Downloads

3

Readme

DEFCON

DEFCON is a highly extensible, multi-scensory information radiator. Out of the box it does nothing, but by installing (or writing) the correct set of plugins it can become a dashboard for events transmitted via any network protocol you want. In addition to displaying these events, it can forward them to other system such as logstash or even another DEFCON instance. There are plugins which play audible alarms when certain events are received.

Prerequisits

  1. nodejs

Installation

mkdir defcon
cd defcon
npm install defcon

Recommended Plugins

DEFCON is useless without plugins. A basic set is provided via individual npm modules which should be installed (with npm install) from the defcon installiation directory, so that the modules are installed as syblings of defcon rather than children, e.g.

/var/opt/defcon$ tree -d -L 2
.
└── node_modules
    ├── defcon
    ├── defcon-event-log
    └── defcon-rest-gateway

The recommended plugins are as follows. Please see their README.md files for installation and configuration.

| Plugin | Description | |--------|-------------| | REST Gateway | Enables DEFCON to receive events via HTTP | | Event Log | Displays a paginated, sortable & filterable table of events | | Logstash UDP | Forwards events to logstash via UDP |

More plugins are planned and we welcome contributions.

Starting

NODE_ENV=production node node_modules/defcon/server.js

DEFCON starts on localhost:8080 by default. You can override this (and any other configuration setting) from the command line, e.g.

NODE_ENV=production node node_modules/defcon/server --server.port=9090

Configuration

Configuration is loaded from the following files if they exist

  1. $INSTALL_DIR/conf/default.json
  2. $INSTALL_DIR/conf/.json
  3. $INSTALL_DIR/conf/.json
  4. $INSTALL_DIR/etc/defcon/defcon.json

You can also specify an additional configuration file from the command line, e.g.

NODE_ENV=production node node_modules/defcon/server.js --config=/path/to/config.json

The final configuration is a merge of the individual configuration files and the command line arguments.

Since defcon is a container for plugins, it's configuration options are minimal. We suggest you add custom settings to /etc/defcon/defcon.json or in a file specified on via the command line, since this is the easiest option for upgrades.

{
    "server": {
        "host": "0.0.0.0",
        "port": 8080,
        "workers": 1
    },
    "plugins": {
        // Specify the list of installed plugins. Order will dictate where the plugins appear in the UI
        installed: [],

        // Insert plugin configuration here, e.g.
        "defcon-event-log": {
            "redis": {
                "host": "localhost",
                "port": 6379,
                "db": 0,
                "options": {
                    "enable_offline_queue": false
                }
            },
            "pageSize": 14,
            "pages": 10
        }
    },
    "logging": {
        // Any entries will be passed directly to winston
        "file": {
            "transport": "File",
            "filename": "defcon.log",
            "maxsize": 1048576,
            "maxFiles": 3,
            "level": "info",
            "colorize": false
        }
    }
}