Registry / messaging / loopd-async

loopd-async

JSON →
library0.4.4jsnpmunverified

A JavaScript/Node.js gRPC client for Lightning Labs Loop (v0.2-alpha), wrapping all callbacks in promises for async/await usage. Supports connecting to loopd via gRPC and can also run as a standalone REST API server. Currently at stable version 0.4.4, with infrequent updates. Differentiators: native promise support eliminates callback nesting; includes a built-in REST server for simplified HTTP access; requires Node.js >= 7.6.0. Security note: loop is early-stage, and the REST server should not be exposed to the internet.

npm install loopd-async
INSTALL
IMPORT
SIG · LOOPD-ASYNC
L
loopd-async
messagingjavascriptv0.4.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export (connect)
const loop = require('loopd-async'); const client = await loop.connect();
import loop from 'loopd-async';
No ESM exports; CJS only. Use require().
connect
const { connect } = require('loopd-async');
const connect = require('loopd-async');
Named export approach also works via destructuring.
REST server start
npm start
REST server is started via CLI, not programmatic import.

Connect to local loopd gRPC endpoint and fetch loop-in terms using async/await.

const loop = require('loopd-async'); async function getTerms() { const client = await loop.connect({ loopHost: 'localhost', loopPort: 11010, }); const terms = await client.getLoopInTerms({}); console.log(terms); } getTerms().catch(console.error);
Debug
Known issues
gotchaREST server exposes full node control; do not expose to internet.
fix
Only run REST on localhost, add auth and TLS.
affects: >=0.0.0
breakingLoop v0.2-alpha API compatibility only; newer Loop versions may break.
fix
Check Loop version compatibility before upgrading loopd.
affects: >=0.0.0
gotchaEnvironment variables for REST mode: LOOPD_BASIC_AUTH_USER and LOOPD_BASIC_AUTH_PASSWORD must be set.
fix
Set env vars or .env file before starting server.
affects: >=0.0.0
deprecatedNode.js >= 7.6.0 required; older versions not supported.
fix
Upgrade Node.js to version 7.6 or later.
affects: <7.6.0
Errors
Common errors & fixes
Error: Cannot find module 'loopd-async'
Package not installed or installed globally incorrectly.
fix
Run 'npm install loopd-async' in your project directory.
TypeError: loop.connect is not a function
Using ESM import syntax with a CJS-only module.
fix
Use 'const loop = require('loopd-async');' instead of import.
Error: 14 UNAVAILABLE: Connection refused
loopd is not running or not reachable on the configured host:port.
fix
Start loopd, verify host and port (default localhost:11010).
Upgrade
Version history
0.4.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
36
Amazon
1
Resources
loopd-async — npm install loopd-async · libregistry