A tiny utility that returns nerf darts from URLs for npm.
Give it a URL and you'll get a "nerf dart":
const nerfGun = require('nerf-gun');
//
// All of these return the same thing
// '//registry.npmjs.org/'
//
nerfGun('http://registry.npmjs.org')
nerfGun('http://registry.npmjs.org')
nerfGun('http://registry.npmjs.org/some-package')
nerfGun('http://registry.npmjs.org/some-package?write=true')
nerfGun('http://user:pass@registry.npmjs.org/some-package?write=true')
nerfGun('http://registry.npmjs.org/#random-hash')
nerfGun('http://registry.npmjs.org/some-package#random-hash')
Copyright (c) 2014, Charlie Robbins and Contributors. Adapted under the ISC License from npm
and npm-registry-client
Copyright (c) 2025, Charlie Robbins and Contributors. Adapted under the Art License from npm
via npm/cli