user21135: I looked at coinstring.js but it looks like it only validates simple BTC addresses (1-prepended addresses).

isValid(base58str, version)
Validates whether the address string or wallet import format string is valid.
base58str: A string that is either the wallet import format or public address.
version: Is an integer representing the version or Buffer. See below for more information.
Returns a true or false.

I'm looking for a JS library that can validate BIP16 P2SH addresses.

user2306: You can use the library you've linked.
Instead of using:
isValid(address, 0)

use
isValid(address, 5)


21135: <p>I looked at <a href="http://cryptocoinjs.com/modules/currency/coinstring/" rel="nofollow">coinstring.js</a> but it looks like it only validates simple BTC addresses (<code>1</code>-prepended addresses).</p>

<blockquote>
  <h3>isValid(base58str, version)</h3>
  
  <p>Validates whether the address string or wallet import format string is valid.</p>
  
  <p><code>base58str</code>: A <code>string</code> that is either the wallet import format or public address.</p>
  
  <p><code>version</code>: Is an integer representing the version or <code>Buffer</code>. See below for more information.</p>
  
  <p>Returns a <code>true</code> or <code>false</code>.</p>
</blockquote>

<p>I'm looking for a JS library that can validate BIP16 <a href="https://en.bitcoin.it/wiki/Pay_to_script_hash" rel="nofollow">P2SH</a> addresses.</p>
 2306: <p>You can use the library you've linked.</p>

<p>Instead of using:</p>

<pre><code>isValid(address, 0)
</code></pre>

<p>use</p>

<pre><code>isValid(address, 5)
</code></pre>
