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

gs-redis-atomic-data-loader

v1.1.3

Published

Codeless redis data loader!!!

Downloads

85

Readme

Codeless redis data loader!!!

What does that mean?

Let me show you

redis-cli lpush phish down
redis-cli lpush in with
redis-cli lpush the disease
redis-cli lpush c food

redis-cli hset Rach no 2
redis-cli hset me is cool
redis-cli hset sideways paul giamathioahiad
{
  FOO: {
    loadArray: ['phish', 'in', 'the', 'c']
  },
  BAR: {
    loadHash: ['Rach', 'me', 'sideways']
  }
}

Okay? What on Earth are you talking about?

Well persons, with just a simple Javascript Object, the gs-redis-atomic-data-loader does the rest for you

Behold! The result:

{
  FOO: ['down', 'with', 'disease', 'food'],
  BAR: {
    no: 2,
    is: 'cool',
    paul: 'giamathioahiad'
  }
}

This isn't telling me anything

Fine then. Maybe this will help?

import {RedisAtomicDataLoader} from 'gs-redis-atomic-data-loader';

let loader = new RedisAtomicDataLoader(redisClient, configFromAbove);
loader.on('done', (cache) => {
  /* cache == resultFromAbove */
});

Neat, I guess. What else?

Not much I'm afraid, although items can be reloaded

let config = Object.assign(configFromAbove, {persist: 'loadAgain!!!'});
let loader = new RedisAtomicDataLoader(redisClient, config);
redis-cli lpush phish fee
redis-cli publish loadAgain!!! FOO

Hopefully (yes, sigh, hopefully) your cache result above now has added 'fee' to the FOO array

Notice the on method used rather than once. Each time data is reloaded, the done event is fired.

The naming leaves much to be desired

Okay, how about liftraft, cherrypie, humptydumpty, codelesschico, chipsandsalsa ...

Shoot I forgot to mention the most important part

npm install gs-redis-atomic-data-loader

Followed by (after a few seconds probably)

npm uninstall gs-redis-atomic-data-loader

I want to Contribute

So do I :(

Oh, to this project.

Fork, create branch, make changes, push with well-formatted commit message, create pull-request

(This change will "commit message", first letter uppercase)