Standardize imports to work in browser + node

This commit is contained in:
Jackson Mills
2021-10-21 16:27:34 -07:00
parent 30d78812b3
commit 55eaed4b68
4 changed files with 24 additions and 4 deletions

View File

@@ -1,4 +1,9 @@
const xrpl = require('xrpl')
// Dependencies for Node.js.
// In browsers, use <script> tags as in the example demo.html.
if (typeof module !== "undefined") {
// gotta use var here because const/let are block-scoped to the if statement.
var xrpl = require('xrpl')
}
async function main() {
// Connect -------------------------------------------------------------------

View File

@@ -1,4 +1,9 @@
const xrpl = require('xrpl')
// Dependencies for Node.js.
// In browsers, use <script> tags as in the example demo.html.
if (typeof module !== "undefined") {
// gotta use var here because const/let are block-scoped to the if statement.
var xrpl = require('xrpl')
}
async function main() {
// Connect -------------------------------------------------------------------

View File

@@ -1,4 +1,9 @@
const xrpl = require('xrpl')
// Dependencies for Node.js.
// In browsers, use <script> tags as in the example demo.html.
if (typeof module !== "undefined") {
// gotta use var here because const/let are block-scoped to the if statement.
var xrpl = require('xrpl')
}
async function main() {
// Connect -------------------------------------------------------------------

View File

@@ -1,4 +1,9 @@
const xrpl = require('xrpl')
// Dependencies for Node.js.
// In browsers, use <script> tags as in the example demo.html.
if (typeof module !== "undefined") {
// gotta use var here because const/let are block-scoped to the if statement.
var xrpl = require('xrpl')
}
async function main() {
// Connect -------------------------------------------------------------------