npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@volontariapp/bridge-nest

v0.3.1

Published

This package provides a seamless integration of the core `@volontariapp/bridge` database connection providers into your NestJS applications.

Readme

@volontariapp/bridge-nest

This package provides a seamless integration of the core @volontariapp/bridge database connection providers into your NestJS applications.

By using @volontariapp/bridge-nest, your NestJS projects will natively support onModuleInit and onModuleDestroy lifecycle hooks. This automatically handles your database connections upon start-up, and gracefully tears them down on application exit. In case of issues, it uniformly propagates exceptions modeled by your custom error suite BRIDGE_CONNECTION_FAILED, etc.

Features

  • PostgresBridgeModule: Easy drop-in registration for Postgres connections via TypeORM.
  • Neo4jBridgeModule: Global module to register a neo4j-driver provider.
  • RedisBridgeModule: Global module for ioredis caches or stores.
  • Custom Providers that can be injected wherever necessary, wrapped correctly inside Nest's context layer.

Installation

yarn add @volontariapp/bridge-nest @volontariapp/bridge @volontariapp/errors @volontariapp/errors-nest

Basic Usage

The modules are exported globally by leveraging @Global(). When you register one, the provider instantly becomes available to any feature modules in your application without needing to specifically import it into every module.ts.

1. Register Modules in Your App

You typically import these inside your AppModule or DatabaseModule:

import { Module } from '@nestjs/common';
import { 
  PostgresBridgeModule, 
  Neo4jBridgeModule, 
  RedisBridgeModule 
} from '@volontariapp/bridge-nest';

@Module({
  imports: [
    PostgresBridgeModule.register({
      host: 'localhost',
      port: 5432,
      username: 'user',
      password: 'pwd',
      database: 'my_db',
      synchronize: true,
    }),
    RedisBridgeModule.register({
      host: 'localhost',
      port: 6379,
    }),
    Neo4jBridgeModule.register({
      url: 'neo4j://localhost:7687',
      authToken: { principal: 'neo4j', credentials: 'password' },
    })
  ],
})
export class AppModule {}

2. Injecting the Providers

Use standard NestJS dependency injection using the provider classes directly in your service layers.

import { Injectable } from '@nestjs/common';
import { NestPostgresProvider, NestRedisProvider, NestNeo4jProvider } from '@volontariapp/bridge-nest';

@Injectable()
export class UserService {
  constructor(
    private readonly postgres: NestPostgresProvider,
    private readonly redis: NestRedisProvider,
    private readonly neo4j: NestNeo4jProvider,
  ) {}

  async doSomething() {
    // Access native TypeORM DataSource
    const pgDriver = this.postgres.getDriver();
    await pgDriver.query('SELECT 1');

    // Access ioredis library
    const cache = this.redis.getDriver();
    await cache.set('auth_token', '12345');

    // Access neo4j driver
    const neoDriver = this.neo4j.getDriver();
    const session = neoDriver.session();
    await session.run('MATCH (n:User) RETURN n');
    await session.close();
  }
}

Error Handling

Internally, these decorators and lifecycles intercept internal provider failures safely and transform them using the monorepo's shared BRIDGE_CONNECTION_FAILED and BRIDGE_DISCONNECTION_FAILED utilities. This ensures any database configuration blunders are communicated explicitly as a 500 InternalServerError.