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 🙏

© 2026 – Pkg Stats / Ryan Hefner

pma-locals-fivem

v1.0.29

Published

FiveM ped spawning and management library with TypeScript support

Readme

npm install pma-locals
# or
pnpm add pma-locals

Quick Start

import { registerPed, processSpawning, cleanupPeds } from "pma-locals";
import { Vector3, Delay } from "@nativewrappers/redm";

// Register a ped with animation
registerPed(
	0x12345678, // model hash
	new Vector3(-297.74, 791.1, 118.4), // spawn coords
	180.0, // heading
	50.0, // spawn distance (optional, default: 100.0)
	true, // disable collisions
	{
		dict: "amb_wander@world_human_smoke@male@male_a@idle_a",
		anim: "idle_a",
	}, // optional animation
	undefined // optional prop data
);

// In your game loop
setTick(async () => {
	const playerPed = Game.PlayerPed;

	await processSpawning(playerPed.Position);
	await Delay(500);
});

// Cleanup on resource stop
on("onResourceStop", (resourceName: string) => {
	if (resourceName === GetCurrentResourceName()) {
		cleanupPeds();
	}
});

API Reference

registerPed(modelName, coords, heading, spawnDistance?, animation?, propData?)

Register a ped to spawn when players are within range.

Parameters:

  • modelName (number): Model hash
  • coords (Vector3): Spawn coordinates
  • heading (number): Ped heading direction (0-360)
  • spawnDistance? (number): Distance threshold (default: 100.0)
  • collisions? (boolean): Optional collision handler
  • animation? (Animation): Optional animation config
    • dict (string): Animation dictionary
    • anim (string): Animation name
  • propData? (Props): Optional prop attachment
    • model (string): Prop model hash
    • boneId (number): Bone to attach to
    • offset (number[]): Position offset [x, y, z]
    • rotation (number[]): Rotation [x, y, z]

processSpawning(playerPos: Vector3)

Process ped spawning/despawning based on player position. Call this regularly in your game loop (e.g., every 500ms).

cleanupPeds()

Delete all spawned peds. Use this when your resource stops to clean up entities.

TypeScript Support

Full type definitions are included. Import types as needed:

import type { PedConfig, Animation, Props } from "pma-locals";

Exported Types:

  • PedConfig - Complete ped configuration
  • Animation - Animation data structure
  • Props - Prop attachment configuration

Development

# Install dependencies
pnpm install

# Build package (creates dist/ with .js and .d.ts files)
pnpm build:package

# RedM development mode (watch)
pnpm watch

# Publish to npm
npm version patch
pnpm publish

Built with:

License

ISC