@varasto/url
v1.0.1
Published
Connect to an Varasto storage based on URL
Readme
@varasto/url
Allows connecting to various types of Varasto storages based on URL.
Installation
$ npm install --save @varasto/urlUsage
The package provides an function called open which takes URL as an argument
and returns promise that resolves into Varasto storage, based on the contents
of the given URL.
import { open } from '@varasto/url';
const storage = await open('file:///path/to/storage/data');
await storage.set('foo', 'bar', { baz: 1 });Supported protocols
| Protocol | Example | Storage implementation |
| ------------------- | --------------------------------------------- | --------------------------- |
| file | file://./directory | @varasto/fs-storage |
| http, https | https://user:pass@localhost:8080/ | @varasto/remote-storage |
| memory | memory:// | @varasto/memory-storage |
| postgres | postgres://user:pass@localhost:381/database | @varasto/postgres-storage |
| redis | redis://1 | @varasto/redis-storage |
| sqlite, sqlite3 | sqlite://file.sqlite | @varasto/sqlite-storage |
