@mann-conomy/tf-war-paints
v1.0.0
Published
A static Node.js wrapper for Team Fortress 2's many War Paints.
Maintainers
Readme
tf-war-paints
A static Node.js wrapper for Team Fortress 2's many War Paints.
Installation
Using npm:
$ npm install @mann-conomy/tf-war-paintsUsing yarn:
$ yarn add @mann-conomy/tf-war-paintsTesting
Using npm:
$ npm testUsing yarn:
$ yarn testExamples
Creating and evaluating War Paints from the Team Fortress 2 game files.
import { WarPaint } from "@mann-conomy/tf-war-paints";
try {
// Create a new War Paint to represent Health and Hell
const paint = new WarPaint({ name: "Health and Hell" });
// Evaluate the War Paint based on the provided name
if (paint.eval()) {
// Retrieve the War Paint's id and name
const { id, name } = paint.find();
console.log(id, name); // 406, Health and Hell
}
} catch (error) {
console.error("Error processing War Paint", error.message);
}Want to keep things simple without class instantiation? Opt for the static functions instead!
import { WarPaint } from "@mann-conomy/tf-war-paints";
try {
// Create a new War Paint to represent Health and Hell Green
const paint = { id: 407 };
// Evaluate the War Paint based on the provided id
if (WarPaint.eval(paint)) {
// Retrieve the War Paint's id and name
const { id, name } = WarPaint.find(paint);
console.log(id, name); // 407, Health and Hell Green
}
} catch (error) {
console.error("Error processing War Paint", error.message);
}Some more examples are available in the examples and test directories.
Documentation
See the Wiki pages for further documentation.
License
Copyright 2025, The Mann-Conomy Project
