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

nexus-stats-api

v1.0.0

Published

HTTP/Socket.io adapter for api.nexus-stats.com

Downloads

17

Readme

Nexus Stats API Package

Installation

npm install nexus-stats-api

Usage

const Nexus = require("nexus-stats-api")
const nexus = new Nexus()

nexus.get("/warframe/v1/items").then(res => console.log(res.body)) // list of all stored items

Configuration

const Nexus = require("nexus-stats-api")
const nexus = new Nexus({key: value})

| Key | Default | Description | |:------------- |:------------- |:------------- | | use_socket | true | Whether or not to use Socket.io as standard request engine. Setting to false uses http. Subscriptions will use Socket.io regardless. | | namespace | "/" | Socket.io namespace to connect to | | user_key | null | (optional) User key obtained via Auth-Node registration | | user_secret | null | (optional) User secret obtained via Auth-Node | | ignore_limiter | false | Whether or not to disable the default rate limit adaptions. Disabling this only makes sense if you connect as a user who won't face rate limits. If you disable it anyway, expect all your requests to get blocked. |

API

For response formats, check the provisional nexus-stats docs

Item Price Stats

nexus.getItemStats(name)

Get detailed item statistics for a given item. Returns a promise with a statistics object.

Item Price List

nexus.getItemPrices()

Returns a list of all items and their overall price stats in the last week.

Supply & Demand

nexus.getItemDistribution()

Returns a list of all items and their supply/demand values.

Player Profiles

nexus.getPlayerProfile(name)

Returns the ingame player profile for given user.

Bot Status

nexus.getBotStatus()

Returns the upstatus for all connected bots.

Subscriptions

Subscriptions allow you to receive real-time data whenever an item is updated. Updates trigger on in-game requests.

nexus.subscribe(endpoint)

Subscribe to updates on a specific endpoint. Updates can be listened to via nexus.on(endpoint, fn).

| Argument | Description | Default | |:------------- |:------------- |:------------- | | endpoint | URL to listen for updates on e.g. /warframe/v1/items/frost prime/statistics | None |

nexus.on(ev, fn)

Listens to specific Socket.io event, then runs the given function with the received data

| Argument | Description | Default | |:------------- |:------------- |:------------- | | ev | Event name. Usually a subscribed endpoint URL. | None | | fn | Function to execute on event trigger | None |

RESTful methods

// GET Request
nexus.get(url)

// POST, PUT, PATCH Requests
nexus.post(url, body)
nexus.put(url, body)
nexus.patch(url, body)

// DELETE Request
nexus.delete(url, body)

Sends a RESTful request to a certain URL (without domain) and returns a promise containing the response data.

See the blitz-js-query documentation for further details on sending RESTful methods.

License

MIT