Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@truffle/db-loader

Package Overview
Dependencies
Maintainers
9
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@truffle/db-loader

Utility for loading @truffle/db

  • 0.2.36
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
9
Created
Source

@truffle/db-loader

A loader for importing Truffle Db that does not throw an error when it is not installed.

Contents

This package's main export is a method called getTruffleDb. To import it, simply destructure it from the package.

const { getTruffleDb } = require("@truffle/db-loader");

When you call the method, it will return an instance of Truffle Db or null if the import fails.

const Db = getTruffleDb();
if (Db === null) {
  throw new Error("There was an error importing Truffle Db.");
}

Note that you will need to do a check for a null value if you want to provide handling for the case where Truffle Db fails to load.

Please see the README for @truffle/db for more information on using Truffle Db.

Keywords

FAQs

Package last updated on 13 Sep 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc