Join 74,346 users and earn money for participation

electrum-cash: getting started

3 170 exc boost
Avatar for JonathanSilverblood
Written by   236
1 year ago (Last updated: 11 months ago)


Electrum-cash is a javascript/typescript library for communicating with electrum servers.

This example demonstrates how to install the library with npm and how to include it in your NodeJS-based project.

It is possible to use the library in a browser and on other platforms by transpiling with tools like babel, webpack and similar, but that is outside the scope of this article.


Before you get started, make sure that you have reasonable modern versions of nodejs and npm installed by opening a terminal prompt and requesting version information:

$ node -v
$ npm -v

Installing the library

To install the electrum-cash library, navigate to your project's root folder and use npm:

$ cd MyProject/
$ npm install electrum-cash

Import the library into your project

The library supports both CommonJS and ES2015, and comes with bindings for TypeScript.

This example includes the full library but you can also include just the parts you need.

// Include the electrum-cash library using CommonJS.
const ElectrumCash = require('electrum-cash');
// Include the electrum-cash library as an ES2015 module.
import * as ElectrumCash from 'electrum-cash';


As long as you have a modern version of NodeJS you should be able to add electrum-cash to your project in just a few minutes.

$ 1.43
$ 0.50 from @emergent_reasons
$ 0.33 from @TheRandomRewarder
$ 0.25 from @rosco
+ 2
Avatar for JonathanSilverblood
Written by   236
1 year ago (Last updated: 11 months ago)
Enjoyed this article?  Earn Bitcoin Cash by sharing it! Explain
...and you will also help the author collect more tips.



$ 0.00
1 year ago

Nice article I Love Thet..

$ 0.00
1 year ago