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

@rbxts/patch-cameramodule

v0.2.1-ts1

Published

Access the CameraModule API in the Roblox PlayerModule

Readme

patch-roblox-cameramodule

Module that provides access to the CameraModule API in the Roblox PlayerModule

Maintained by @6ixfalls

How to use

This module returns a function that should be called on the CameraModule before PlayerModule has had a chance to run. The easiest place to do this is in the PlayerScriptsLoader, but this may or may not be the right place depending on the rest of your project.

For example:

-- PlayerScriptsLoader
local PlayerModule = script.Parent:WaitForChild("PlayerModule")
local CameraModule = PlayerModule:WaitForChild("CameraModule")
local PatchCameraModule = script.Parent:WaitForChild("PatchCameraModule")

require(PatchCameraModule)(CameraModule)

local playerModuleObject = require(PlayerModule)
local cameraModuleObject = playerModuleObject:GetCameras()

-- the api is public!
print(cameraModuleObject)

-- can overwrite the functions
local prevUpdateFunc = cameraModuleObject.Update
function cameraModuleObject.Update(self, ...)
	print(...)
	prevUpdateFunc(self, ...)
end

A note on CameraModule descendants

When this patch runs it renames the CameraModule to _CameraModule and creates a redirection module named CameraModule that points to the new patched value. This is done b/c as a result of the patch trying to require _CameraModule will cause a infinite yield.

local CameraModule = require(game.Players.LocalPlayer.PlayerModule.CameraModule)
print(CameraModule) -- this works!

local CameraModule = require(game.Players.LocalPlayer.PlayerModule._CameraModule)
print(CameraModule) -- this will never print b/c the above line yields forever!

As a result of this an important decision needed to be made on the development end of this patch. The module named CameraModule returns the patched value, but it doesn't have any of the descendants that _CameraModule does. This is problematic if the user of this patch is trying to access any of those descendants by standard naming conventions.

-- This doesn't exist!
local TransparencyController = require(game.Players.LocalPlayer.PlayerModule.CameraModule.TransparencyController)
-- It's here instead!
local TransparencyController = require(game.Players.LocalPlayer.PlayerModule._CameraModule.TransparencyController)

You might just suggest to move all the descendants of _CameraModule to the new CameraModule and at the time of writing this that would work, but it could easily break in the future if any of the camera code becomes dependant on the expected parent-child relationship.

The solution I decided to use instead is to continue to use redirection modules and proxy values. Instead of moving the descendants out from _CameraModule I instead create a duplicate hierarchy under CameraModule with module scrips and values that redirect to the values under _CameraModule.

This is the best way to get behavior parity with the default CameraModule that I can think of at the moment. If you want to be extra safe you can always reference the path via _CameraModule to avoid worrying about the redirection modules and proxies.