Socket
Socket
Sign inDemoInstall

keyv

Package Overview
Dependencies
1
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.5 to 4.1.0

.nyc_output/17c338d1-cd21-4d2f-9d97-398f18a945cf.json

2

.nyc_output/processinfo/index.json

@@ -1,1 +0,1 @@

{"processes":{"37411020-4142-4b08-b825-343ba2427bf7":{"parent":null,"children":["cd79f2de-c8b8-4493-bc15-b2bde28efa4b"]},"cd79f2de-c8b8-4493-bc15-b2bde28efa4b":{"parent":"37411020-4142-4b08-b825-343ba2427bf7","children":[]}},"files":{"/Users/jaredwray/src/github.com/jaredwray/keyv/packages/keyv/src/index.js":["cd79f2de-c8b8-4493-bc15-b2bde28efa4b"]},"externalIds":{}}
{"processes":{"17c338d1-cd21-4d2f-9d97-398f18a945cf":{"parent":"67b1f344-0eec-41a3-a665-c824c346e898","children":[]},"67b1f344-0eec-41a3-a665-c824c346e898":{"parent":null,"children":["17c338d1-cd21-4d2f-9d97-398f18a945cf","adb04494-7d0a-443f-9130-94b19c3fa19c"]},"adb04494-7d0a-443f-9130-94b19c3fa19c":{"parent":"67b1f344-0eec-41a3-a665-c824c346e898","children":[]}},"files":{"/Users/jaredwray/src/github.com/jaredwray/keyv/packages/keyv/src/index.js":["adb04494-7d0a-443f-9130-94b19c3fa19c"]},"externalIds":{}}
{
"name": "keyv",
"version": "4.0.5",
"version": "4.1.0",
"description": "Simple key-value storage with support for multiple backends",

@@ -38,7 +38,2 @@ "main": "src/index.js",

"devDependencies": {
"@keyv/mongo": "*",
"@keyv/mysql": "*",
"@keyv/postgres": "*",
"@keyv/redis": "*",
"@keyv/sqlite": "*",
"@keyv/test-suite": "*",

@@ -49,2 +44,3 @@ "ava": "^3.15.0",

"nyc": "^15.1.0",
"pify": "5.0.0",
"this": "^1.0.2",

@@ -51,0 +47,0 @@ "timekeeper": "^2.0.0",

@@ -9,3 +9,3 @@ <h1 align="center">

[![build](https://github.com/jaredwray/keyv/actions/workflows/build.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/build.yaml)
[![build](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/jaredwray/keyv/branch/master/graph/badge.svg?token=bRzR3RyOXZ)](https://codecov.io/gh/jaredwray/keyv)

@@ -48,2 +48,3 @@ [![npm](https://img.shields.io/npm/dm/keyv.svg)](https://www.npmjs.com/package/keyv)

npm install --save @keyv/mysql
npm install --save @keyv/etcd
```

@@ -63,2 +64,3 @@

const keyv = new Keyv('mysql://user:pass@localhost:3306/dbname');
const keyv = new Keyv('etcd://localhost:2379');

@@ -106,3 +108,3 @@ // Handle DB connection errors

The official storage adapters are covered by [over 150 integration tests](https://github.com/jaredwray/keyv/actions/workflows/build.yaml) to guarantee consistent behaviour. They are lightweight, efficient wrappers over the DB clients making use of indexes and native TTLs where available.
The official storage adapters are covered by [over 150 integration tests](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml) to guarantee consistent behaviour. They are lightweight, efficient wrappers over the DB clients making use of indexes and native TTLs where available.

@@ -116,2 +118,3 @@ Database | Adapter | Native TTL

MySQL | [@keyv/mysql](https://github.com/jaredwray/keyv/tree/master/packages/mysql) | No
Etcd | [@keyv/etcd](https://github.com/jaredwray/keyv/tree/master/packages/etcd) | Yes

@@ -294,4 +297,82 @@ ## Third-party Storage Adapters

# How to Contribute
In this section of the documentation we will cover:
1) How to set up this repository locally
2) How to get started with running commands
3) How to contribute changes using Pull Requests
## Dependencies
This package requires the following dependencies to run:
1) [Yarn V1](https://yarnpkg.com/getting-started/install)
2) [Lerna](https://lerna.js.org/)
3) [Docker](https://docs.docker.com/get-docker/)
## Setting up your workspace
To contribute to this repository, start by setting up this project locally:
1) Fork this repository into your Git account
2) Clone the forked repository to your local directory using `git clone`
3) Install any of the above missing dependencies
## Launching the project
Once the project is installed locally, you are ready to start up its services:
1) Ensure that your Docker service is running.
2) From the root directory of your project, run the `yarn` command in the command prompt to install yarn.
3) Run the `yarn bootstrap` command to install any necessary dependencies.
4) Run `yarn test:services:start` to start up this project's Docker container. The container will launch all services within your workspace.
## Available Commands
Once the project is running, you can execute a variety of commands. The root workspace and each subpackage contain a `package.json` file with a `scripts` field listing all the commands that can be executed from that directory. This project also supports native `yarn`, `lerna`, and `docker` commands.
Here, we'll cover the primary commands that can be executed from the root directory. Unless otherwise noted, these commands can also be executed from a subpackage. If executed from a subpackage, they will only affect that subpackage, rather than the entire workspace.
### `yarn`
The `yarn` command installs yarn in the workspace.
### `yarn bootstrap`
The `yarn bootstrap` command installs all dependencies in the workspace.
### `yarn test:services:start`
The `yarn test:services:start` command starts up the project's Docker container, launching all services in the workspace. This command must be executed from the root directory.
### `yarn test:services:stop`
The `yarn test:services:stop` command brings down the project's Docker container, halting all services. This command must be executed from the root directory.
### `yarn test`
The `yarn test` command runs all tests in the workspace.
### `yarn clean`
The `yarn clean` command removes yarn and all dependencies installed by yarn. After executing this command, you must repeat the steps in *Setting up your workspace* to rebuild your workspace.
## Contributing Changes
Now that you've set up your workspace, you're ready to contribute changes to the `keyv` repository.
1) Make any changes that you would like to contribute in your local workspace.
2) After making these changes, ensure that the project's tests still pass by executing the `yarn test` command in the root directory.
3) Commit your changes and push them to your forked repository.
4) Navigate to the original `keyv` repository and go the *Pull Requests* tab.
5) Click the *New pull request* button, and open a pull request for the branch in your repository that contains your changes.
6) Once your pull request is created, ensure that all checks have passed and that your branch has no conflicts with the base branch. If there are any issues, resolve these changes in your local repository, and then commit and push them to git.
7) Similarly, respond to any reviewer comments or requests for changes by making edits to your local repository and pushing them to Git.
8) Once the pull request has been reviewed, those with write access to the branch will be able to merge your changes into the `keyv` repository.
If you need more information on the steps to create a pull request, you can find a detailed walkthrough in the [Github documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
## License
MIT © Jared Wray & Luke Childs

@@ -6,2 +6,7 @@ 'use strict';

// eslint-disable-next-line no-extend-native
BigInt.prototype.toJSON = function () {
return this.toString();
};
const loadStore = options => {

@@ -16,2 +21,3 @@ const adapters = {

mysql: '@keyv/mysql',
etcd: '@keyv/etcd',
};

@@ -62,3 +68,3 @@ if (options.adapter || options.uri) {

.then(data => {
if (data === undefined) {
if (data === undefined || data === null) {
return undefined;

@@ -91,2 +97,6 @@ }

const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null;
if (typeof value === 'symbol') {
this.emit('error', 'symbol cannot be serialized');
}
value = { value, expires };

@@ -93,0 +103,0 @@ return this.opts.serialize(value);

const test = require('ava');
const keyvTestSuite = require('@keyv/test-suite').default;
const { keyvOfficialTests } = require('@keyv/test-suite');
const { default: keyvTestSuite, keyvOfficialTests } = require('@keyv/test-suite');
const Keyv = require('this');

@@ -9,3 +8,2 @@ const tk = require('timekeeper');

keyvOfficialTests(test, Keyv, 'sqlite://test/testdb.sqlite', 'sqlite://non/existent/database.sqlite');
const store = () => new KeyvSqlite({ uri: 'sqlite://test/testdb.sqlite', busyTimeout: 3000 });

@@ -12,0 +10,0 @@ keyvTestSuite(test, Keyv, store);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc