@keyv/postgres
Advanced tools
Comparing version 1.4.11 to 2.0.0
{ | ||
"name": "@keyv/postgres", | ||
"version": "1.4.11", | ||
"version": "2.0.0", | ||
"description": "PostgreSQL storage adapter for Keyv", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/esm/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/cjs/index.js", | ||
"import": "./dist/esm/index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "tsc --project tsconfig.dist.json", | ||
"build": "rm -rf dist && tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json", | ||
"prepare": "yarn build", | ||
"test": "xo && c8 ava --serial", | ||
"test:ci": "xo && ava --serial", | ||
"test": "xo --fix && vitest run --coverage", | ||
"test:ci": "xo && vitest --run --sequence.setupFiles=list", | ||
"clean": "rm -rf node_modules && rm -rf ./coverage" | ||
@@ -17,28 +24,14 @@ }, | ||
"import/extensions": "off", | ||
"n/file-extension-in-import": "off", | ||
"unicorn/prefer-event-target": "off", | ||
"promise/prefer-await-to-then": "off", | ||
"unicorn/prefer-module": "off", | ||
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off", | ||
"unicorn/prefer-node-protocol": "off", | ||
"@typescript-eslint/no-unsafe-return": "off", | ||
"@typescript-eslint/no-confusing-void-expression": "off", | ||
"ava/no-ignored-test-files": [ | ||
"error", | ||
{ | ||
"extensions": [ | ||
"js", | ||
"ts" | ||
] | ||
} | ||
] | ||
"import/no-extraneous-dependencies": "off", | ||
"@typescript-eslint/no-unnecessary-type-assertion": "off" | ||
} | ||
}, | ||
"ava": { | ||
"require": [ | ||
"requirable", | ||
"ts-node/register" | ||
], | ||
"extensions": [ | ||
"js", | ||
"ts" | ||
] | ||
}, | ||
"repository": { | ||
@@ -68,10 +61,10 @@ "type": "git", | ||
"dependencies": { | ||
"pg": "8.11.5" | ||
"pg": "8.12.0" | ||
}, | ||
"devDependencies": { | ||
"@keyv/test-suite": "*", | ||
"@types/pg": "^8.11.5", | ||
"keyv": "*", | ||
"requirable": "^1.0.5", | ||
"tsd": "^0.31.0" | ||
"@types/pg": "^8.11.6", | ||
"keyv": "^5.0.0", | ||
"tsd": "^0.31.1", | ||
"xo": "^0.59.3" | ||
}, | ||
@@ -82,7 +75,8 @@ "tsd": { | ||
"engines": { | ||
"node": ">= 14" | ||
"node": ">= 18" | ||
}, | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"LICENSE" | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
# @keyv/postgres [<img width="100" align="right" src="https://jaredwray.com/images/keyv.svg" alt="keyv">](https://github.com/jaredwra/keyv) | ||
# @keyv/postgres [<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwra/keyv) | ||
@@ -23,5 +23,6 @@ > PostgreSQL storage adapter for Keyv | ||
```js | ||
const Keyv = require('keyv'); | ||
import Keyv from 'keyv'; | ||
import KeyvPostgres from '@keyv/postgres'; | ||
const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname'); | ||
const keyv = new Keyv(new KeyvPostgres('postgresql://user:pass@localhost:5432/dbname')); | ||
keyv.on('error', handleConnectionError); | ||
@@ -35,3 +36,3 @@ ``` | ||
```js | ||
const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname', { table: 'cache' }); | ||
const keyv = new Keyv(new KeyvPostgres('postgresql://user:pass@localhost:5432/dbname'), { table: 'cache' }); | ||
``` | ||
@@ -44,3 +45,3 @@ | ||
```js | ||
const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname', { schema: 'keyv' }); | ||
const keyv = new Keyv(new KeyvPostgres('postgresql://user:pass@localhost:5432/dbname'), { schema: 'keyv' }); | ||
``` | ||
@@ -50,3 +51,3 @@ | ||
When testing you can use our `docker-compose` postgresql instance by having docker installed and running. This will start a postgres server, run the tests, and stop the server: | ||
When testing you can use our `docker compose` postgresql instance by having docker installed and running. This will start a postgres server, run the tests, and stop the server: | ||
@@ -65,2 +66,2 @@ At the root of the Keyv mono repo: | ||
MIT © Jared Wray | ||
[MIT © Jared Wray](LISCENCE) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31582
21
381
63
1