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

@pstehlik/dharma.js

v0.1.76

Published

<img src="https://s3-us-west-2.amazonaws.com/dharma-assets/logo+orange.png" width=300/>

Downloads

4

Readme


Hello, dharma.js!

CircleCI

This repository contains the dharma.js client application development libraries. dharma.js makes it easy for developers who may not be deeply familiar with smart contract development to interact with the various components of Dharma protocol and build hyper-flexible lending applications.

For more information, please check out the Dharma Developer Portal.

Getting Started with Dharma.js

Installing Dharma.js

Add Dharma.js to your project using yarn:

yarn add @dharmaprotocol/dharma.js

Alternatively, add Dharma.js to your project using npm:

npm install @dharmaprotocol/dharma.js --save

Importing Dharma.js

Include Dharma.js in your project code using ES6 style imports (recommended):

import { Dharma } from "@dharmaprotocol/dharma.js";

Alternatively, include Dharma.js in your project code using require syntax:

const { Dharma } = require("@dharmaprotocol/dharma.js");

Instantiating Dharma.js

In order to instantiate Dharma.js, you need to specify a web3 provider.

The web3 provider can either be instantiated directly, or pulled from the browser's window object.

Instantiating the web3 provider directly

You'll want to instantiate a web3 provider directly if you're:

  • running Dharma.js on a backend
  • working with a local blockchain

You'll first import Dharma and Web3 from the Dharma.js package:

import { Dharma, Web3 } from "@dharmaprotocol/dharma.js";

Assuming you're running a local blockchain on localhost port 8545, you'd specify the provider as follows:

const host = "http://localhost:8545";
const provider = new Web3.providers.HttpProvider(host);

You'd then pass the above provider to the Dharma constructor, using JavaScript's new operator to construct an instance of Dharma connected to your local blockchain:

const dharma = new Dharma(provider);

Pulling the web3 provider off the browser's window object

If the user is interacting with your dApp via a web3 wallet (e.g., MetaMask, Coinbase Wallet, etc.), you can pull the web3 provider from the browser's window object and pass that to the Dharma constructor:

const provider = window.web3.currentProvider;

const dharma = new Dharma(provider);