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 🙏

© 2026 – Pkg Stats / Ryan Hefner

influx-gateway

v0.1.5

Published

an influxdb gateway, takes json as input

Readme

influx-gateway

Build Status NPM version Code Climate

InfluxDB had a json protocol but it will be deprecated, this service helps you to write json into influxDB.

How to deploy

Firstly, install:

$ npm install influx-gateway -g

Then command igw or influx-gateway will be available.

Now we need a configuration file for influx-gateway, you can see the example by running:

$ igw genconfig

Create a config file, and then we can run the server:

$ igw -c [configfile]

Configuration

Config is quite straight forward. The only tricky part is: if your influxdb requires authentication, you should include the username and password in the influx_url.

Authentication

Influx-gateway does not provide authentication, you can put a proxy in front of igw. For example, an nginx instance with basic auth check enabled.

API

  • GET /ping

Ping will check the influxdb connectivity.

  • POST /event

This API would transform json input into influx db's line protocol message. See Here for more information about line-protocol.

Example payload:

{
  "_name": "cpu",
  "__f1": 1,
  "tag1": "v1",
  "tag2": "v2"
}

_name must be specified as the measurement name, type must be string, regex: /^[a-zA-Z0-9][\w-\.\/]*$/

Field name starts with __[a-zA-Z0-9], and remaining part use the same rule as measurement name.

Field value can be number, boolean or string.

Fields are optional, if no fields in the payload, igw will add count=1i automatically.

Tag name and tag value also should follow the measurement name regex.

Tags are also optional.

  • POST /query

This API accepts influxdb query and returns json result. Query must start with SELECT.

Example payload:

{
  "q": "SELECT value FROM cpu_load_short WHERE region='us-west'",
}

Example result:

{
  "latency": 230,
  "series": [
    {
      "name": "cpu_load_short",
      "columns": [
        "time",
        "value"
      ],
      "values": [
        [
          "2015-01-29T21:55:43.702900257Z",
          0.55
        ],
        [
          "2015-01-29T21:55:43.702900257Z",
          23422
        ],
        [
          "2015-06-11T20:46:02Z",
          0.64
        ]
      ]
    }
  ]
}

Changelog

2016-02-24 0.1.5 Add query latency in response.

2016-02-23 0.1.4 Add query api.

2015-10-13 0.1.3 Upgrade dependencies.

2015-10-11 0.1.2 1st working version.