{"id":15286994,"url":"https://github.com/runcitadel/deno-lndconnect","last_synced_at":"2025-10-20T16:29:52.723Z","repository":{"id":58002713,"uuid":"529559649","full_name":"runcitadel/deno-lndconnect","owner":"runcitadel","description":"Generate and parse lndconnect URIs","archived":true,"fork":false,"pushed_at":"2023-02-05T15:12:16.000Z","size":180,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T02:52:16.685Z","etag":null,"topics":["bitcoin","deno","lightning","lightning-network"],"latest_commit_sha":null,"homepage":"https://deno.land/x/lndconnect","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/runcitadel.png","metadata":{"funding":{"github":"runcitadel","opencollective":"runcitadel"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-27T11:00:55.000Z","updated_at":"2025-09-01T06:48:05.000Z","dependencies_parsed_at":"2023-02-19T00:15:32.306Z","dependency_job_id":null,"html_url":"https://github.com/runcitadel/deno-lndconnect","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/runcitadel/deno-lndconnect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runcitadel%2Fdeno-lndconnect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runcitadel%2Fdeno-lndconnect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runcitadel%2Fdeno-lndconnect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runcitadel%2Fdeno-lndconnect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runcitadel","download_url":"https://codeload.github.com/runcitadel/deno-lndconnect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runcitadel%2Fdeno-lndconnect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280118987,"owners_count":26275360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","deno","lightning","lightning-network"],"created_at":"2024-09-30T15:20:13.696Z","updated_at":"2025-10-20T16:29:52.371Z","avatar_url":"https://github.com/runcitadel.png","language":"TypeScript","funding_links":["https://github.com/sponsors/runcitadel","runcitadel"],"categories":[],"sub_categories":[],"readme":"# simple-lndconnect\n\n[![codecov](https://codecov.io/github/runcitadel/deno-lndconnect/branch/main/graph/badge.svg?token=Uh0EXCsxAH)](https://codecov.io/github/runcitadel/deno-lndconnect)\n\n\u003e Generate and parse lndconnect uris https://github.com/LN-Zap/lndconnect ⚡️\n\nThis package is a modernized and cleaned up version of the original [node-lndconnect](https://github.com/LN-Zap/node-lndconnect).\n\nFor more information take a look at the [specification of the uri format](https://github.com/LN-Zap/lndconnect/blob/master/lnd_connect_uri.md).\n\n## Table of Contents\n\n- [Usage](#usage)\n- [Maintainers](#maintainers)\n- [Contribute](#contribute)\n\n## Usage\n\n**format({ host, cert, macaroon }):**\n\nFormats a host / cert / macaroon combo into an lndconnect link.\n\n```javascript\nimport { format } from 'https://deno.land/x/lndconnect/mod.ts'\nconst connectionString = format({\n  host: '1.2.3.4:10009',\n  cert: 'MIICuDCCAl...',\n  macaroon: '0201036c6...',\n})\nexpect(connectionString).toEqual('lndconnect://1.2.3.4:10009?cert=MIICuDCCAl...\u0026macaroon=0201036c6...')\n```\n\n**encode({ host, cert, macaroon }):**\n\nEncodes a host / cert / macaroon combo and formats into an lndconnect link.\n\n```javascript\nimport { encode } from 'https://deno.land/x/lndconnect/mod.ts'\nconst connectionString = encode({\n  host: '1.2.3.4:10009',\n  cert: '-----BEGIN CERTIFICATE-----\\n...',\n  macaroon: '0201036c6...',\n})\nexpect(connectionString).toEqual('lndconnect://1.2.3.4:10009?cert=MIICuDCCAl...\u0026macaroon=AgEDbG5kAr...')\n```\n\n**decode(lndconnectUri):**\n\nDecodes an lndconnect link into it's component parts (host / cert as utf8 / macaroon as hex)\n\n```javascript\nimport { decode } from 'https://deno.land/x/lndconnect/mod.ts'\nconst { host, cert, macaroon } = decode('lndconnect://1.2.3.4:10009?cert=MIICuDCCAl...\u0026macaroon=AgEDbG5kAr...')\nexpect(host).toEqual('1.2.3.4:10009')\nexpect(cert).toEqual('MIICuDCCAl...')\nexpect(macaroon).toEqual('0201036c6...')\n```\n\n#### Certificate\n\n**encodeCert(cert):**\n\nEncodes a certificate (String) or a path to a certifiate (string) to base64url encoded DER format.\nIf you provide a path, the path is encoded, not the contents of the file with that path.\n\n```javascript\nimport { encodeCert } from 'https://deno.land/x/lndconnect/mod.ts'\nconst certPath = path.join(__dirname, 'tls.cert')\nconst cert = encodeCert(certPath)\n// returns base64url encoded DER cert.\nexpect(cert).toEqual('MIICuDCCAl...')\n```\n\n**decodeCert(encodedCert):**\n\nDecodes a certificate from base64url encoded DER format to a string.\n\n```javascript\nimport { decodeCert } from 'https://deno.land/x/lndconnect/mod.ts'\n// pass a base64url encoded DER cert\nconst cert = decodeCert(encodedCert)\n// returns utf8 encoded PEM cert.\nexpect(cert).toEqual('-----BEGIN CERTIFICATE-----\\n...')\n```\n\n#### Macaroon\n\n**encodeMacaroon(macaroon):**\n\nEncodes a binary macaroon (hex string or binary UInt8Array) or a path to a macaroon (string) to base64url encoded string.\nIf you provide a path, the path is encoded, not the contents of the file with that path.\n\n```javascript\nimport { encodeMacaroon } from 'https://deno.land/x/lndconnect/mod.ts'\nconst macaroonPath = path.join(__dirname, 'admin.macaroon')\nconst macaroon = encodeMacaroon(macaroonPath)\n// returns base64url encoded macaroon.\nexpect(macaroon).toEqual('AgEDbG5kAr...')\n```\n\n**decodeMacaroon(encodedMacaroon):**\n\nDecodes a base64url encoded macaroon to a hex encoded macaroon.\n\n```javascript\nimport { decodeMacaroon } from 'https://deno.land/x/lndconnect/mod.ts'\n// pass a base64url encoded macaroon\nconst macaroon = decodeMacaroon(encodedMacaroon)\n// returns hex encoded macaroon.\nexpect(macaroon).toEqual('0201036c6...')\n```\n\n### Testing\n\nRun the tests suite:\n\n```bash\n  deno test\n```\n\n## Maintainers\n\n[@AaronDewes](https://github.com/AaronDewes).\n\n## Contribute\n\nFeel free to dive in! [Open an issue](https://github.com/runcitadel/deno-lndconnect/issues/new) or submit PRs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruncitadel%2Fdeno-lndconnect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruncitadel%2Fdeno-lndconnect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruncitadel%2Fdeno-lndconnect/lists"}