![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
This is a JavaScript implementation for the CashAddr address format used in Bitcoin Cash. It serves as a glue to integrate the @scure/btc-signer library with Bitcoin Cash.
This library depends on and is heavily coupled with the @scure/base and @scure/btc-signer libraries.
npm install cashaddr
import { Address, NETWORK } from 'cashaddr';
import { hex } from '@scure/base';
const hash = hex.decode('f5bf48b397dae70be82b3cca4793f8eb2b6cdac9');
const address = Address(NETWORK).encode({
format: 'cashaddr',
type: 'pkh',
hash,
});
console.log(address);
// bitcoincash:qr6m7j9njldwwzlg9v7v53unlr4jkmx6eylep8ekg2
const decoded = Address(NETWORK).decode('bitcoincash:qr6m7j9njldwwzlg9v7v53unlr4jkmx6eylep8ekg2');
console.log(decoded);
// { type: 'pkh', hash: Uint8Array(20) [...], format: 'cashaddr' }
const legacy = Address(NETWORK).encode({
format: 'legacy',
type: 'pkh',
hash,
});
console.log(legacy);
// 1PQPheJQSauxRPTxzNMUco1XmoCyPoEJCp
const converted = Address(NETWORK).toCashAddress('1PQPheJQSauxRPTxzNMUco1XmoCyPoEJCp');
console.log(converted);
// bitcoincash:qr6m7j9njldwwzlg9v7v53unlr4jkmx6eylep8ekg2
MIT
FAQs
Bitcoin Cash CashAddr
The npm package cashaddr receives a total of 16 weekly downloads. As such, cashaddr popularity was classified as not popular.
We found that cashaddr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.