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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fivem-3d-text

v0.1.0-beta.4

Published

3D text libary for fivem

Readme

Fivem 3D Text

A Javascript based package for 3D text helpers roughly based on the Lua package motiontext. The primary functionality is to display 3D text to the player when they are within range of a set of coordinates.

demo

Created based on fivem-ts-boilerplate repo.

Improvements over other 3D text packages

In addition to the functions implemented this package implements a distance base interval retry so that the client does not needlessly perform the distance logic over and over. It will instead try to update the retry interval based on the distance from the text coordinates. This should result in better performance by only checking distance frequently when the player is close to the text coordinates and otherwise increasing the retry interval when we are further away.

Plot of distance vs. interval:

plot

There may be some edge cases with very large or very small radii in which this has unexpected results.

Installation

Node

The preferred method is to use a standard JavaScript or TypeScript environment and install with npm:

npm install --save fivem-3d-text

fivem

If you are using Lua or C# you can utilize this package through the exports object to utilize them. To "install" in this method just clone this repository into your server-data folder and add fivem-3d-text to your server configuration.

Usage

There are two primary function:

draw3DTextPermanent - draws text that will be visible as long as the player is in range.

draw3DTextTimeout - draws text that will dissapear after the specified timeout.

Check the configuration options here and the full documentation here.

Examples:

Node

import { draw3DTextPermanent } from 'fivem-3d-text'

async function testDraw() {
  const config = {
    x: -1377.514282266, // at the airport
    y: -2852.64941406,
    z: 13.9448,
    text: 'Test',
    radius: 15,
  }
  draw3DTextPermanent(config);
}

RegisterCommand('draw', testDraw, false);

exports

If using the exports object:

exports.motiontext:Draw3DTextPermanent(...configuration)

Development

Prerequisites for development are node LTS and a working fivem server locally.

Clone this repository into your server location and add fivem-3d-text to your server configuration. To watch the code and reload file changes run npm run watch.

To build the final package with optimizations run npm run build.

Resource Usage

Below is a comparison of resource usage in cases with 1, 10, and 100 instances of 3D text active.

Baseline with no 3D texts created

img1

One instance of 3D text

With one text resource usage appears relatively small. fivem-3d-text is somewhat larger while text is visible, this seems to be normal for JavaScript based resources.

Visible

img2

Out of range

img4 img3

10 Instances of 3D text

With 10 instances of permanent text active and out of range we're pretty even. Especially as we move further away from the markers.

Just out of range

img6 img5

Very far out of range

img8 img7

100 instances of 3D text

With 100 instances distance starts to matter. fivem-3d-text's interval seems to add a lot of improvement.

Not too far out of range

img9

Very far out of range

This is the ideal case for fivem-3d-text and where it performs the best against. This use case more or less represents a server where there are many interactables (doors, npcs, etc.) that are waiting to be within range of the use.

img11 img10