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

crystalys

v0.2.1

Published

A wrapper for Valve's DOTA2 WebAPI that uses promises and ES6 techniques!

Downloads

19

Readme

Crystalys

A wrapper for Valve's DOTA2 Web API. Crystalys is part of the Daedalus suite. Crystalys is intended for server-side requests, while Demon Edge (not yet in development) will handle client-side requests. The Daedalus npm package is a deployable API server written with express.js.

Before you use Crystalys, please note: Crystalys is still being developed and does not yet have a stable release.

Installing

To install Crystalys install it using npm just as you would for any other npm package npm install crystalys

Using Crystalys

In order to use Crystalys you must have a Steam API key which you can grab from here. Also note that if you don't have a Steam account, you will need one in order to retrieve an API key.

Valve's terms of use for their API states that you must make your API calls from the server-side, or redirect your client-side calls to your own server. Crystalys is only intended to make calls server-side. Client-side calls can be made from another tool in the Daedalus suite Demon Edge (link will be provided once its made!)

Once you've got your very own API key, you can start to actually use Crystalys!

var Crystalys = require('crystalys');

Crystalys.setApiKey('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');

var promise = Crystalys.api.Match.GetMatchHistory.sendRequest();

promise.then(function(response) {
    var data = response.result;
    // do things with your retrieved data!
});

In order to pass parameters you can tack function calls on the endpoint before the sendRequest call like so:

var promise = api.Match.GetMatchHistory.heroID(1).matchesRequested(300).sendRequest()

This will grab the most recent 300 matches with Antimage in them (heroID 1) A JSON file with KV pairs for Hero name to HeroID will likely be added in a future update.

For a good reference on the current Steam API I recommend this site over the official documentation on the TF2 wiki.

You may have noticed that currently the parameter functions follow a different naming scheme from what the actual API uses. This may change in the future to match the API's naming scheme, but personally I prefer heroID() to hero_id(), and other underline delimited parameter names, plus using a sort of camelCase naming scheme seems to be more consistent than the API's due to some being camelCase and some being underline_delimited.

If the community feels strongly one way or another it could definitely influence the naming scheme in Crystalys.

If you have any questions or issues with Crystalys feel free to post an issue here on GitHub or shoot me an email at [email protected]