Coder Social home page Coder Social logo

kv.js's People

Contributors

cadienvan avatar jelveh avatar nikeee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kv.js's Issues

Create Typescript typings

NPM packages nowadays are developed using Typescript and type definitions are exported from the library so that methods and classes are typed. Since this library is entirely written in javascript, one of the following two can be picked to provide type definitions:

  1. Convert the library to typescript and export interfaces
  2. Submit type definitions to definitely typed repository so that consumers can add optional typings using npm install -D @types/heyputer__kvjs

Personally, and I believe most others as well, would like to see no. 1 picked and this library converted into a typescript one.

i did not understand the usage

hello.
what is the use of this lib? i didn't understand properly.
(whats the difference between this and a simple value/variable in js?)

cdn

Hi

Is it supported CDN way?

Thanks
Eric Xin

Expire with NX option

Saw your project on https://news.ycombinator.com/item?id=35608601 and the expires command seems wrong

kv.js/README.md

Lines 119 to 120 in 596ba10

// Set a key's time to live in seconds only if the key does not exist
kv.expire('username', 120, 'NX');

Shouldn't kv.expire('username', 120, 'NX'); mean "Set expirity of username to 60 seconds if it has no expirity"? The documentation suggests "Set expirity of username to 60 seconds if username does not exist" which makes no sense (as the key does not exist and thus can't have expirity).

See redis docs for reference/suggestion https://redis.io/commands/expire/

‌‌Performance test

‌‌‌It looks powerful, but is there a better way to compare its performance? Let's compare its performance with Redis, LocalStorage, and file storage in terms of storage and read speed, making it easier for everyone to choose.

Add ability to watch a key for changes

It's often useful to be able to run a callback whenever a certain value changes. For example, maybe whenever the user's timezone changes, different parts of the app want to react in different ways to update clocks and other things.

For example:

const kvjs = require('@heyputer/kv.js');

// Create a new kv.js instance
const kv = new kvjs();

// Watch the key for changes
kv.watch('foo', value => {
	console.log('foo changed!', value);
});

// Set a key
kv.set('foo', 42);

// Console will log 'foo changed! 42'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.