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

screepsplus-agent

v1.6.2

Published

[![NPM info](https://nodei.co/npm/screepsplus-agent.png?downloads=true)](https://npmjs.org/package/screepsplus-agent)

Downloads

84

Readme

ScreepsPlus node agent

NPM info

Circle CI

Requirements

Node.js 8+

Setup

Prerequisites

  1. Token from ScreepsPl.us
  2. Screeps Login info
  3. Node + NPM

Google Compute Engine

Bonzaiferroni has written a nice guide for setting up on the Google Compute Engine free tier, check it out here

NPM

npm install -g screepsplus-agent
screepsplus-agent

Manual

  1. Download
  2. Configure with config.js
  3. npm install
  4. node app.js

Docker

To use with docker, just do the following: With Config:

docker run -d -v $(pwd):/config --restart=unless-stopped screepsplus-agent

With CLI: (See Config section below for full argument list)

docker run -d --restart=unless-stopped screepsplus-agent --token <screepsToken> --sptoken <screepsPlusToken>

or build your own image:

docker build -t screepsplus-agent .
docker run -d -v $(pwd):/config/ --restart=always screepsplus-agent

Docker-compose

A docker-compose.yml is included.

Config

Config is done via a config file or cli arguments. On start it will search for configs in several locations:

  • Manually Specified via ENV variable (AGENT_CONFIG_PATH)
  • App directory (config.js)
  • Home directory (~/.screepsplus-agent) (Mac, Linux)
  • Etc directory (/etc/screepsplus-agent/config.js) (Mac, Linux)
  • App Data (%APPDATA%/screepsplus-agent/config.js) (Windows)

On windows, it will write a sample config to appdata if no config is found.

All CLI options override the matching config option CLI Usage:

  Usage: app [options]

  Options:

    -V, --version              output the version number
    -u, --username <username>  Private Server Username
    -p, --password <password>  Private Server Password
    -t, --token <token>        Screeps Auth Token
    -s, --segment <id>         Use Segment ID for stats
    -m, --memory               Use Memory for stats (default)
    -c, --console              Use console for stats
    -a, --sptoken <token>      ScreepsPl.us token
    --host <host>              Private Server host and port (ex: host:port)
    --https                    Use HTTPS for Private Server
    --no-updatecheck           Skip check for updates
    -v                         Verbose
    -h, --help                 output usage information

It also possible to use the console to output stats, just set method to console in config.js or pass --console on the CLI and use console.log('STATS;'+formattedStats)

For this to work, type based format is REQUIRED

NOTE: you should use ';' instead of newLine ("\n") as a delimiter

Stat formats supported by ScreepsPl.us:

Memory.stats object

The usual grafana data format

{
  rooms: {
  	W0N0:{
  		level:2
  	}
  }
}

Type based format

This is a more advanced system that allows you to send raw stats pre-formatted. There should always be a 3 line header,

type
tick
time

followed by the raw stat data

For ScreepsPl.us, type can be one of 3 values: 'text/grafana' 'text/influxdb' 'application/json'

Where application/json inserts into graphite.

text/grafana Format

1 stat per line: stat value

EX: room.W0N0.level 5

text/influxdb Format

1 stat per line: stat[,tag1=value,tag2=value,...] key=value[,key=value,...]

EX: room,name=W0N0 level=5,energy=300,energyCapacity=300

NOTE: as of this writing this README, influxdb support is enabled, but cannot be accessed without requesting influxdb credentials