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 🙏

© 2024 – Pkg Stats / Ryan Hefner

jsredisorm

v1.0.2

Published

jsRedisORM is a Node.js library that provides an Object-Relational Mapping (ORM) interface for interacting with Redis. It simplifies the process of working with Redis as a cache or a data store in your Node.js applications.

Downloads

1

Readme

jsRedisORM

jsRedisORM is a Node.js library that provides an Object-Relational Mapping (ORM) interface for interacting with Redis 4.6.7. It simplifies the process of working with Redis as a cache or a data store in your Node.js applications.

Installation

You can install jsRedisORM using npm:

npm install jsredisorm

Usage

To use jsRedisORM in your project, import the createClient function from the Redis library and the jsRedisORM class from the jredis-orm package:

import { createClient } from "redis";
import jsRedisORM from "jsRedisORM.js";

Create an instance of the jsRedisORM class by providing the required Redis connection details:

const redis = new jsRedisORM(
  host,
  port,
  (username = null),
  (password = null),
  (tlsOptions = null),
  (dbIndex = 0),
  (keyPrefix = "")
);

Connecting to Redis

Before interacting with Redis, you need to establish a connection. Use the connect method to connect to the Redis server:

await redis.connect();

###Caching Data NodeRedisORM provides methods to set, get, and delete key-value pairs, lists, sets, hashes, and more. Here are some examples:

// Set a value in Redis
await redis.set("key", "value");

// Get a value from Redis
const value = await redis.get("key");

// Delete a key from Redis
await redis.delete("key");

Disconnecting from Redis

To disconnect from the Redis server, you can use the quit method:

await redis.quit();

API Documantation

The following methods are available in the jsRedisORM class:

connect(): Connects to the Redis server.
set(key, value, expiration): Sets a value for the specified key in Redis.
get(key): Retrieves the value for the specified key from Redis.
delete(key): Deletes the specified key from Redis.
setList(key, values, expiration): Sets a list of values for the specified key in Redis.
getList(key): Retrieves the list of values for the specified key from Redis.
deleteList(key): Deletes the list associated with the specified key from Redis.
setSet(key, values, expiration): Sets a set of values for the specified key in Redis.
getSet(key): Retrieves the set of values for the specified key from Redis.
deleteSet(key): Deletes the set associated with the specified key from Redis.
setHash(key, values, expiration): Sets a hash of key-value pairs for the specified key in Redis.
getHash(key): Retrieves the hash of key-value pairs for the specified key from Redis.
deleteHash(key): Deletes the hash associated with the specified key from Redis.

Contributing

Contributions to jsRedisORM are welcome! If you find any bugs or have suggestions for improvements, please feel free to open an issue or submit a pull request.