use npm package to validate a package name : <p>Is there a way to use the npm package to validate a package name?</p>

<pre><code>const npm = require('npm');

const isValid = npm.validatePackageName('foobar'); // true
const isValid = npm.validatePackageName('-4! *'); // false
</code></pre>

<p>I see a userland package that does this, but surely the npm package itself can do this? Is there a public utility exported from that package?</p>
