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

sourcemod.js

v2.0.0

Published

A JavaScript wrapper over SourceMod

Downloads

2

Readme

npm github downloads

A JavaScript wrapper over SourceMod.

SourceMod by itself is a modification to Source servers, such as Team Fortress 2 and Counter-Strike: Global Offensive. It allows you to write plugins that modify the game in all sorts of ways, from new gamemodes, to simple administration plugins. SourceMod.JS is a wrapper over SourceMod that lets you write plugins or custom server logic in JavaScript.

The JavaScript side (where you write your code) interfaces with an actual SourceMod server (where you install the plugin), via WebSockets. This effectively allows you to wirelessly control a server over the internet, but it is heavily recommended to host the SourceMod.JS plugin on the same machine (or network) as the actual SourceMod server, to reduce latency.

npm install sourcemod.js
import { Server } from "../index.js"

const server = new Server("ws://localhost:12345", { auth: "admin" })
server.connect()

server.on("ready", async () => {
	console.log("Connected!")

	server.players.on("connect", (id, name) => {
		console.log(`${name} connected!`)
	})
	server.players.on("disconnect", (id, name) => {
		console.log(`${name} disconnected!`)
	})
})

// node test.js
// Connected!
// infinixius connected!
// infinixius disconnected!

Documentation is available at https://sourcemod.js.org/.

Contributing

Before creating an issue or pull request, please ensure that it hasn't already been reported or suggested, and double-check the docs.

Currently, the only supported and tested game server is Team Fortress 2. If you'd like to help port and test sourcemod.js to other Source games, feel free to!

Other than that, feel free to contribute! Bugfixes, new features, or just better code in general are all greatly appreciated!

If you need help at any point, please feel free to contact me! You can find all of my links at https://infinixi.us, and my Discord is infinixius#5875. You can also ask for help on the issues page.

License

This project is under the MIT License. This allows you to use, modify, and distribute the source code as long as you include the license.

This project also makes use of the following libraries and/or projects:

Big thanks to punteroo for helping with the GiveWeapon code!