cactus-stl

Standard library for CactusDev TypeScript projects

Showing:

Popularity

Downloads/wk

4

GitHub Stars

1

Maintenance

Last Commit

1yr ago

Contributors

0

Package

Dependencies

2

License

MIT

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

cactus-stl

Standard library for CactusDev TypeScript projects

Usage

Using RedisController

import { RedisController } from "cactus-stl";

async function setup() {
    // Create the redis handler
    const handler = new RedisController({
        db: 0,
        host: "localhost",
        port: 6379,
        password: "awesome_password"
    });

    // Connect to redis
    await handler.connect();
    console.log("Connected to Redis!");

    // Set and get
    await handler.set("foo", "bar");
    console.log("Value of foo: " + await handler.get("foo"));

    // Can also set expiration
    await handler.set("potato", "salad", 100);

    // Pub / Sub is built right into the handler!
    // You can also use .unsubscribe, which only takes the channel.
    await handler.subscribe("cool_channel", (message: string) => {
        console.log("Got a really cool message!", message);
    });

    await handler.publish("cool_channel", "Hello world!");

    // Delete
    await handler.delete("foo");

    // Increment a variable
    await handler.increment("potato");

    // Make sure to disconnect!
    await handler.disconnect();
}

setup();

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial