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

node-artifact-api

v0.4.2

Published

A node module wrapper for the Valve official Artifact API

Downloads

6

Readme

Node Artifact Api Build Status npm version Open Issues

This is a node wrapper for the official Valve Artifact API, with Typescript support

Installation

Install with NPM

npm i --save node-artifact-api

import singular methods, or full api as object

import { decodeDeck, encodeDeck, getSet } from 'node-artifact-api';

// OR

import * as ArtifactApi from 'node-artifact-api';

then use any of the methods below.

Project written in Typescript and has types support out of the box.

Features

  • Fetching card set by ID
  • Fetching cards by ID
  • In-memory caching
  • Decoding deck codes
  • Encoding decks into deck codes

More is coming soon, especially once the Beta is released on the 19th and I can play with the client directly for more test data.

For a full API Documentation, click here

Feature Roadmap

The following is a list of features planned for release with this API in the coming weeks:

  • ~~Individual Card Fetching~~ (Done in v0.3.0!)
  • System for passing a "caching" middleware (In Progress)
    • In memory caching completed with v0.3.0!
  • ~~Deck Decoding~~ (Done in v0.2.0!)
  • ~~Deck Encoding~~ (Done in v0.4.0! (thank you to artbarte for your work!)

Caching

As of v0.3.0 the getCard and getSet methods cache in-memory according to Valve's API Guidelines:

After receiving the response, you must then request the JSON file from the host specified. In this example, "https://some host/some path/somefile.json". Please cache the provided JSON for AT LEAST until the expire time provided.

By default the above methods will use this caching rule. Cache can be cleared with an optional parameter provided to each method. It is not advised to clear caches outside of the API rules unless you are having issues or are handling caching separately, in order to avoid being blocked from accessing the API.

Contributors

Feel free to open a PR or log an issue if you would work on this repo.

Thank you to the following people for contributing so far!