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

quickset

v1.0.0

Published

quickset is a module that allows you to easily share variables with other modules

Downloads

6

Readme

quickset

quickset is a module that allows you to easily share variables with other modules.

Installation

npm i quickset --save

Keep in mind, it's stored in RAM, if you put a massive ass data set in ram your computer will hate you :) This also means that once the process stops ALL DATA is lost.

If you have enough ram, you can store a pretty big dataset, the speed in which it grabs the values is virtually instant. This is like a virtual database but much much faster, don't forget once the process closes all data is lost.

Example

test.js

const { set } = require('quickset');

setInterval(() => {
	set('pewpy_pants', 'I just pewped my pants ' + Math.random() + ' times');
}, 2000);

testTwo.js

const { get, set, destroy, returnKeysThatMatchString } = require('quickset');

...

server.get('/get', (req, res) => {
	// returns null if property does not exist
	res.send(get('pewpy_pants'));
});

server.get('/getkeys', (req, res) => {
	// once you have the key names that contain that string
	// you can loop to grab each value using get()
	res.send(returnKeysThatMatchString('pewpy'));
});

server.get('/set', (req, res) => {
	set('pewpy_pants', 'I pewped my pants');
	res.send('set pewpy_pants');
});

server.get('/remove', (req, res) => {
	destroy('pewpy_pants');
	res.send(get('pewpy_pants'));
});

...

Methods

get ( 'property_name' )

const { get } = require('quickset');

console.log(get('pewpy_pants'));
  • get() will return null if property does not exist

set ( 'property_name' , property_value )

const { set } = require('quickset');

set('pewpy_pants', 'I pooped my pants');
  • set() will create property if property does not exist

destroy ( 'property_name' )

const { destroy } = require('quickset');

destroy('pewpy_pants');

returnKeysThatMatchString ( 'searchString' )

const { returnKeysThatMatchString } = require('quickset');

console.log(returnKeysThatMatchString('pewpy'));

Crack that sucka open to see how easy it is, when you understand how it works using it becomes much much easier...ENJOY!