Socket
Socket
Sign inDemoInstall

keyv

Package Overview
Dependencies
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyv - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

dist/index.cjs

16

package.json
{
"name": "keyv",
"version": "5.0.0",
"version": "5.0.1",
"description": "Simple key-value storage with support for multiple backends",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
"require": "./dist/index.cjs",
"import": "./dist/index.js"
}
},
"scripts": {
"build": "rm -rf dist && tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json",
"build": "rm -rf dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",

@@ -23,2 +24,3 @@ "test": "xo --fix && vitest run --coverage",

"rules": {
"import/no-named-as-default": "off",
"unicorn/prefer-module": "off",

@@ -25,0 +27,0 @@ "unicorn/prefer-node-protocol": "off",

@@ -153,7 +153,7 @@ [<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwra/keyv)

const keyv = new Keyv();
keyv.hooks.addListener(KeyvHooks.PRE_SET, (key, value) => console.log(`Setting key ${key} to ${value}`));
keyv.hooks.addHandler(KeyvHooks.PRE_SET, (key, value) => console.log(`Setting key ${key} to ${value}`));
//POST_SET hook
const keyv = new Keyv();
keyv.hooks.addListener(KeyvHooks.POST_SET, (key, value) => console.log(`Set key ${key} to ${value}`));
keyv.hooks.addHandler(KeyvHooks.POST_SET, (key, value) => console.log(`Set key ${key} to ${value}`));
```

@@ -165,3 +165,3 @@

const keyv = new Keyv();
keyv.hooks.addListener(KeyvHooks.PRE_SET, (key, value) => {
keyv.hooks.addHandler(KeyvHooks.PRE_SET, (key, value) => {
console.log(`Setting key ${key} to ${value}`);

@@ -168,0 +168,0 @@ key = `prefix-${key}`;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc