ethers.js/docs/getting-started/README.md
2020-02-17 17:56:50 -05:00

1.2 KiB

Documentation: html

Getting Started

Installing

The various Classes and Functions are available to be imported manually from sub-packages under the @ethersproject but for most projects, the umbrella package is the easiest way to get started.

/home/ricmoo> npm install --save ethers@next

Importing

Node.js

// CommonJS
const { ethers } = require("ethers");

// ES6 or TypeScript 
const { ethers } = require("ethers");

Web Browser

It is generally better practice (for security reasons) to copy the ethers library to your own webserver and serve it yourself.

For quick demos or prototyping though, it can be loaded in your Web Applications from our CDN.

<script src="https://cdn.ethers.io/lib/ethers-5.0.esm.min.js"
        type="application/javascipt"></script>

Content Hash: 56c46ac0fa7f1a71d4de04e0f6615f10073f21fa7a5294f71c29bbb3ee842c31