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 🙏

© 2025 – Pkg Stats / Ryan Hefner

concordapi

v1.2.0

Published

The Official Concord REST API Package for Node.js

Readme

ConcordAPI

ConcordAPI is intended to be a simple way of interacting with the Concord Services and it's REST API via Node.js.

JavaScript Style Guide

Notice: This module is in early development, and may have minor bugs and inconveniences, this module is under active development by the Concord Team and Community

Getting Started

Install the Concord-API NPM Package with:

npm i concordapi

And require the module in your Node.js application with:

var concord = require("concordapi")

Using the API

Reading Concord Exchange (CXDx) Prices

To check a coin's price in CXD use:

concord.price(string).then(price => {
  console.log(price) // Logs the price of 'string'
})

For example, using:

var coin = "IC"

concord.price(coin).then(price => {
  console.log(coin + " is priced at " + price + " CXD") // Logs the price of 'IC'
})

Would log the price of IC (Ignition Coin) live from the Concord Exchange.

Reading Concord Social Platform (CSP) Profiles

There are two options you can choose from, to read data from a user's profile.

Method One - Via the user Object

The user Object contains all public data of a user's profile, the contents of the object can be seen by stringifying the result of the function:

/* userID is the DiscordID of the user who's profile you're reading from, as a string */
concord.getUser(userID).then(user => {
  console.log("User's full data object: "+JSON.stringify(user))

	console.log("User's balance is "+user.balance)
	console.log("User's Discord Username is "+user.discordUsername)
	console.log("User's Discord ID is "+user.discordID)
})

Method Two - Individual Profile elements

If you don't want to use the full object, or want to create a Lightweight function without accessing the object, you can use:

concord.getBalance(userID).then(balance => {
  console.log("Balance of "+userID+" is " + balance + " CXD")
})

Sending a Transaction through ConcordPay

ConcordPay is a simple online interface for the Lightnet transaction system, transactions can be sent directly to any registered Lightnet User from any integrated Platform.

To send a transaction, you first need to provide your Concord Home account credentials in an Object, as shown below:

var auth = {u: 'username-here', p: 'password-here'} /* Replace values with your real credentials! */

Once you've entered your Auth-data, send your transaction!

var amount = 25 /* The amount of Concord (CXD) you are sending */
var to = 'username-of-transaction-receiver' /* This is the user Receiving the transaction */

concord.send(auth, amount, to).then(response => { /* Sends your Auth and Transaction data to Lightnet for processing */
  console.log(response) /* Logs the API's response to the console. E.G: "(User)'s Payment Has Sent!'" */
})

And to Receive transactions, simply give your Concord Home username to the application/user that wants to pay you

Full Examples

Examples in this section can be freely copy/pasted into your code and modified to your choosing, and when unmodified and authenticated, "just work"

Example 1. Continuously pulling a Concord Exchange coin price

  /* This script would run indefinitely until the console/terminal is closed manually */
var concord = require("concordapi")

var coin = "IC" // A Coin listed on the CXDx to check the price of, in CXD.
setInterval(checkPrice, 5000) // Check coin price every 5 seconds

function checkPrice () {
  	concord.price(coin).then(price => {
		console.log('1 '+coin+' is '+price+' CXD') // Prints the price of the CXDx Coin
  	})
}

Example 2. Authenticating and sending a Transaction

var auth = {u: 'username-here', p: 'password-here'}
var amount = 25  /* The amount of Concord (CXD) you are sending */
var to = 'username-of-receiver'  /* This is the user Receiving the transaction */

concord.send(auth, amount, to).then(response => { /* The API Package function, to send the payment to the Lightnet Server */
  console.log(response)  /* Logs the API's response to the console. E.G: "(User)'s Payment Has Sent!'" */
})