user3029: How would one validate a bitcoin address using the bitcoinjs library? Or is there another way to do this via javascript?

user2306: If you call
bitcoin.address.toOutputScript(address, bitcoin.networks.bitcoin)

It will throw an error if the address cannot be parsed as P2SH or P2PKH, or if the checksum is not valid. Replace the second argument with bitcoin.networks.testnet for testnet.

3029: <p>How would one validate a bitcoin address using the bitcoinjs library? Or is there another way to do this via javascript?</p>
 2306: <p>If you call</p>

<pre><code>bitcoin.address.toOutputScript(address, bitcoin.networks.bitcoin)
</code></pre>

<p>It will throw an error if the address cannot be parsed as P2SH or P2PKH, or if the checksum is not valid. Replace the second argument with <code>bitcoin.networks.testnet</code> for testnet.</p>
