Catwork - your modular object framework, and cat companion!

Catwork

Quick Links

Download Button GitHub

Catwork is a declarative, asynchronous object framework that motivates you to write safer, asynchronous code.

Simple to use, but powerful

Catwork code can be placed in a Script, or ModuleScript, it runs the same way regardless as objects are run on creation and not when they’re returned.

Catwork.new {
	Init = function(self)
		print("Hello World!")
	end
}

Asynchronous by design

If your code yields, you can await upon it in other Catwork objects

local YieldingObject = require(script.YieldingObject)

Catwork.new {
	[Catwork.meta "AwaitFor"] = {
		YieldingObject
		-- preferred way of doing this
	},

	Init = function(self)
		-- if you alternatively want to handle the response of an awaiting call
		-- do not use with AwaitFor because you just do the same thing twice

		local ok, err = YieldingObject:Await()
	end
}

Extensible

Services allow you to expand Catwork beyond what it was originally designed for.

Catwork.Service {
	Name = "BoopYourObject",

	CreateObject = function(self, params)
		params.Boopable = true
	end
}

A great example of a service can be viewed here which wraps CollectionService into tag handlers.

Installation

Catwork is provided as both an rbxm and zip file on GitHub. We do not maintain Wally packages though they are present.

For Roblox users, you can simply drag the RBXM into ReplicatedFirst and start coding straight away with Catwork!

For developers who use other solutions, simply unpack the zip file and drag it into your ReplicatedFirst section of your project

Why use ReplicatedFirst

ReplicatedFirst is always loaded first, and you may want to write code that is processed before anything else.

Attributions

5 Likes

could you possibly convert it into a roblox model? not everyone finds sourcing code on GitHub and building from scratch appealing or convenient.

Here’s the latest build. I dont maintain a build on the repository as its a little inconvenient to keep rebuilding it. I can make a quick source builder from the sourcecode’s zip file if thats what you want?

build.rbxm (10.4 KB)

Here’s that source builder, drop it into your workspace and just require it using the command bar.

CatworkInstaller.rbxm (10.5 KB)

2 Likes

Thread updated for 0.5.0 builds, enjoy!

1 Like