Skip to content
Simon Sørensen edited this page Apr 7, 2023 · 7 revisions

unusual-effects

A Node.js wrapper for Team Fortress 2's Unusual particle effects.

Documentation

When you require() the module, the isUnusual, findEffectByName, findEffectById, getEffectImages and getEffectImages functions are returned. This page lists all parameters and types available for each function.

However, you can also require individual functions and types exported by the module using destructuring.

Below is a CommonJS example:

// Only require the getEffectImages function
const { getEffectImages } = require('unusual-effects');

A list of exported functions and types is available here.

Functions and Types

Most of the functions use primitive JavaScript types, however, a few use custom interfaces to represent objects and have been made available through TypeScript imports.

isUnusual (effect)

  • effect - Any Unusual effect name (string) or id (Number).

Returns true if the effect matches any known Unusual effect, otherwise false.

findEffectByName (effect)

  • effect - The name of the Unusual effect.

Returns the id matching the effect parameter, otherwise null.

findEffectById (id)

  • id - The id of the Unusual effect.

Returns the name of the Unusual effect matching the id parameter, otherwise null.

getEffectImages (effect)

  • effect - Any Unusual effect name (string) or id (Number).

Returns an GetEffectImagesResponse object containing the effect's name, id and links to the particle effects on Backpack.tf, otherwise null.

getEffectFromObject (item)

  • item - An EconItem object that represents an item within the Steam economy.

Returns an GetEffectFromObjectResponse object containing the effect's name, standardized name, id and links to the particle effects on Backpack.tf, otherwise null.

Examples

For now, there are some examples available in the test directory.

Support

Feel free to create an issue if you need to report any bugs or have a suggestion for a new feature.

Clone this wiki locally