🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@osaas/client-db

Package Overview
Dependencies
Maintainers
11
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@osaas/client-db

Open Source Cloud Client SDK database library

0.6.0
latest
Source
npm
Version published
Maintainers
11
Created
Source

@osaas/client-db

SDK for Open Source Cloud DB services

Usage

Prerequisites

  • An account on Open Source Cloud
npm install --save @osaas/client-db

Example code creating a Valkey database and use a Redis client to connect with it

import { Context } from '@osaas/client-core';
import { setupDatabase } from '@osaas/client-db';
import Redis from 'ioredis';

async function main() {
  const ctx = new Context();
  const dbUrl = await setupDatabase(ctx, 'valkey', 'myvalkey', {
    password: 'secret'
  });
  const client = new Redis(dbUrl);
  try {
    await client.subscribe('messages');
    console.log('Waiting for messages...');
    client.on('message', (channel, message) => {
      console.log(`Received message: ${message} from ${channel}`);
    });
  } catch (err) {
    console.error('Error:', err);
  }
}

main();

FAQs

Package last updated on 03 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts