@keyv/postgres
Advanced tools
Comparing version 2.0.3 to 2.0.4
import EventEmitter from 'events'; | ||
import { KeyvStoreAdapter } from 'keyv'; | ||
import Keyv, { KeyvStoreAdapter } from 'keyv'; | ||
import { PoolConfig } from 'pg'; | ||
@@ -32,3 +32,4 @@ | ||
} | ||
declare const createKeyv: (options?: KeyvPostgresOptions) => Keyv<any>; | ||
export { KeyvPostgres, KeyvPostgres as default }; | ||
export { KeyvPostgres, type KeyvPostgresOptions, createKeyv, KeyvPostgres as default }; |
// src/index.ts | ||
import EventEmitter from "events"; | ||
import Keyv from "keyv"; | ||
@@ -137,6 +138,8 @@ // src/pool.ts | ||
}; | ||
var createKeyv = (options) => new Keyv({ store: new KeyvPostgres(options) }); | ||
var src_default = KeyvPostgres; | ||
export { | ||
KeyvPostgres, | ||
createKeyv, | ||
src_default as default | ||
}; |
163
package.json
{ | ||
"name": "@keyv/postgres", | ||
"version": "2.0.3", | ||
"description": "PostgreSQL storage adapter for Keyv", | ||
"type": "module", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean", | ||
"prepare": "yarn build", | ||
"test": "xo --fix && vitest run --coverage", | ||
"test:ci": "xo && vitest --run --sequence.setupFiles=list", | ||
"clean": "rimraf ./node_modules ./coverage ./dist" | ||
}, | ||
"xo": { | ||
"rules": { | ||
"import/no-named-as-default": "off", | ||
"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", | ||
"import/no-extraneous-dependencies": "off", | ||
"@typescript-eslint/no-unnecessary-type-assertion": "off", | ||
"@typescript-eslint/no-unnecessary-type-arguments": "off" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/jaredwray/keyv.git" | ||
}, | ||
"keywords": [ | ||
"postgres", | ||
"postgresql", | ||
"sql", | ||
"keyv", | ||
"storage", | ||
"adapter", | ||
"key", | ||
"value", | ||
"store", | ||
"cache", | ||
"ttl" | ||
], | ||
"author": "Jared Wray <me@jaredwray.com> (http://jaredwray.com", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/jaredwray/keyv/issues" | ||
}, | ||
"homepage": "https://github.com/jaredwray/keyv", | ||
"dependencies": { | ||
"pg": "8.13.0" | ||
}, | ||
"devDependencies": { | ||
"@keyv/test-suite": "*", | ||
"@types/pg": "^8.11.10", | ||
"keyv": "^5.0.1", | ||
"rimraf": "^6.0.1", | ||
"tsd": "^0.31.2", | ||
"xo": "^0.59.3" | ||
}, | ||
"tsd": { | ||
"directory": "test" | ||
}, | ||
"engines": { | ||
"node": ">= 18" | ||
}, | ||
"files": [ | ||
"dist", | ||
"LICENSE" | ||
] | ||
} | ||
"name": "@keyv/postgres", | ||
"version": "2.0.4", | ||
"description": "PostgreSQL storage adapter for Keyv", | ||
"type": "module", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.js" | ||
} | ||
}, | ||
"xo": { | ||
"rules": { | ||
"import/no-named-as-default": "off", | ||
"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", | ||
"import/no-extraneous-dependencies": "off", | ||
"@typescript-eslint/no-unnecessary-type-assertion": "off", | ||
"@typescript-eslint/no-unnecessary-type-arguments": "off" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/jaredwray/keyv.git" | ||
}, | ||
"keywords": [ | ||
"postgres", | ||
"postgresql", | ||
"sql", | ||
"keyv", | ||
"storage", | ||
"adapter", | ||
"key", | ||
"value", | ||
"store", | ||
"cache", | ||
"ttl" | ||
], | ||
"author": "Jared Wray <me@jaredwray.com> (http://jaredwray.com", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/jaredwray/keyv/issues" | ||
}, | ||
"homepage": "https://github.com/jaredwray/keyv", | ||
"dependencies": { | ||
"pg": "8.13.1", | ||
"keyv": "*" | ||
}, | ||
"devDependencies": { | ||
"@keyv/test-suite": "*", | ||
"@types/pg": "^8.11.10", | ||
"rimraf": "^6.0.1", | ||
"tsd": "^0.31.2", | ||
"xo": "^0.59.3" | ||
}, | ||
"tsd": { | ||
"directory": "test" | ||
}, | ||
"engines": { | ||
"node": ">= 18" | ||
}, | ||
"files": [ | ||
"dist", | ||
"LICENSE" | ||
], | ||
"scripts": { | ||
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean", | ||
"test": "xo --fix && vitest run --coverage", | ||
"test:ci": "xo && vitest --run --sequence.setupFiles=list", | ||
"clean": "rimraf ./node_modules ./coverage ./dist" | ||
} | ||
} |
@@ -46,2 +46,10 @@ # @keyv/postgres [<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwra/keyv) | ||
You can also use a helper function to create `Keyv` with `KeyvPostgres` store. | ||
```js | ||
import {createKeyv} from '@keyv/postgres'; | ||
const keyv = createKeyv({ uri: 'postgresql://user:pass@localhost:5432/dbname', table: 'cache', schema: 'keyv' }); | ||
``` | ||
## Testing | ||
@@ -53,3 +61,3 @@ | ||
```shell | ||
yarn test:services:start | ||
pnpm test:services:start | ||
``` | ||
@@ -59,3 +67,3 @@ | ||
```shell | ||
yarn test | ||
pnpm test | ||
``` | ||
@@ -62,0 +70,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
18761
5
350
71
2
1
+ Addedkeyv@*
+ Added@keyv/serialize@1.0.3(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedkeyv@5.3.1(transitive)
+ Addedpg@8.13.1(transitive)
- Removedpg@8.13.0(transitive)
Updatedpg@8.13.1