Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@mann-conomy/tf-particle-effects

Mann-Conomy44MIT1.3.0TypeScript support: included

A Node.js wrapper for Team Fortress 2's in-game particle effects.

nodejs, json, typescript, localization, tf2, particle-effects, mann-conomy

readme

tf-particle-effects

A Node.js wrapper for Team Fortress 2's in-game particle effects.

npm version npm downloads Node.js version GitHub actions GitHub license

Installation

Using npm:

$ npm install @mann-conomy/tf-particle-effects

Using yarn:

$ yarn add @mann-conomy/tf-particle-effects

Testing

Using npm:

$ npm test

Using yarn:

$ yarn test

Examples

Creating and evaluating Unusual particle effects from the Team Fortress 2 game files.

import { UnusualEffect } from "@mann-conomy/tf-particle-effects";

try {
    // Create a new Unusual effect to represent Burning Flames
    const effect = new UnusualEffect({ name: "Burning Flames" });

    // Evaluate the Unusual effect based on the provided name
    if (effect.eval()) {
        // Retrieve the Unusal effect's particle id and name
        const { id, name } = effect.find();

        console.log(id, name); // 13, Burning Flames
    }
} catch (error) {
    console.error("Error processing Unusual effect", error.message);
}

Want to keep things simple without class instantiation? Opt for the static functions instead!

import { KillstreakEffect } from "@mann-conomy/tf-particle-effects";

try {
    // Create a new Killstreak effect to represent Singularity
    const effect = { id: 2006 };

    // Evaluate the Killstreak effect based on the provided id
    if (KillstreakEffect.eval(effect)) {
        // Retrieve the Killstreak effect's name
        const { name } = KillstreakEffect.find(effect);

        console.log("Killstreaker:", name); // Killstreaker: Singularity
    }
} catch (error) {
    console.error("Error processing Killstreak effect", error.message);
}

Some more examples are available in the examples and test directories.

Documentation

See the Wiki pages for further documentation.

License

MIT

Copyright 2025, The Mann-Conomy Project