{"name":"npm-name","version":"8.1.1","description":"Check whether a package or organization name is available on npm","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/npm-name.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["name","available","package","organization","npm","pkg","app","check","taken"],"dependencies":{"is-scoped":"^3.0.0","is-url-superb":"^6.1.0","ky":"^1.2.0","lodash.zip":"^4.2.0","org-regex":"^1.0.0","p-limit":"^6.2.0","p-map":"^7.0.1","registry-auth-token":"^5.0.2","registry-url":"^6.0.1","validate-npm-package-name":"^5.0.0"},"devDependencies":{"ava":"^6.1.1","tsd":"^0.30.4","unique-string":"^3.0.0","xo":"^0.57.0"},"gitHead":"4e1bdb4a204a977ecab6c6287e04ef3b1129c055","types":"./index.d.ts","_id":"npm-name@8.1.1","bugs":{"url":"https://github.com/sindresorhus/npm-name/issues"},"homepage":"https://github.com/sindresorhus/npm-name#readme","_nodeVersion":"22.23.1","_npmVersion":"12.0.1","dist":{"integrity":"sha512-dPKFWBATFnnAuLYCM1h0OmSnYuOWx6R3gEZp1Aj+cnBu3dvGbMKGkLcSCBZHD2Df03bBY/44U0b5AbRVWtkt5g==","shasum":"ce7b11ecedf912d5ddbfc82bc3e457e30f9fe352","tarball":"http://registry-npm.ywwl.com/npm-name/download/npm-name-8.1.1.tgz","fileCount":5,"unpackedSize":12203,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBvt99Dsf3dBhLXTqZj0qv1Ki0lmQBZ/RSfO5OWKhVNKAiEAyxsUmvNyCkcfqwihNXscT7WSnE9hCZ7XvXxTzlyu2AY="}],"size":4504,"noattachment":false,"key":"/npm-name/-/npm-name-8.1.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/npm-name_8.1.1_1786878807519_0.02383437317263315"},"_hasShrinkwrap":false,"readme":"# npm-name\n\n> Check whether a package or organization name is available on npm\n\n## Install\n\n```sh\nnpm install npm-name\n```\n\n## Usage\n\n```js\nimport npmName from 'npm-name';\n\n// Check a package name\nconsole.log(await npmName('chalk'));\n//=> false\n\n// Check an organization name\nconsole.log(await npmName('@ava'));\n//=> false\n\nconsole.log(await npmName('@abc123'));\n//=> true\n\ntry {\n\tawait npmName('_ABC');\n} catch (error) {\n\tconsole.log(error.message);\n\t// Invalid package name: _ABC\n\t// - name cannot start with an underscore\n\t// - name can no longer contain capital letters\n}\n```\n\n## API\n\n### npmName(name, options?)\n\nCheck whether a package/organization name is available (not registered) on npm.\n\nAn organization name should start with `@` and should not be a scoped package.\n\nReturns a `Promise<boolean>` of whether the given name is available.\n\n#### name\n\nType: `string`\n\nThe name to check.\n\n#### options\n\nType: `object`\n\n##### registryUrl\n\nDefault: User's configured npm registry URL.\n\nThe registry URL to check name availability against.\n\n**Note:** You're unlikely to need this option. Most use-cases are best solved by using the default. You should only use this option if you need to check a package name against a specific registry.\n\n### npmNameMany(names, options?)\n\nCheck whether multiple package/organization names are available (not registered) on npm.\n\nReturns a `Promise<Map>` of name and status.\n\n```js\nimport {npmNameMany} from 'npm-name';\n\nconst result = await npmNameMany(['chalk', '@sindresorhus/is', 'abc123']);\n\nconsole.log(result.get('chalk'));\n//=> false\n\nconsole.log(result.get('@sindresorhus/is'));\n//=> false\n\nconsole.log(result.get('abc123'));\n//=> true\n```\n\n#### names\n\nType: `string[]`\n\nMultiple names to check.\n\n#### options\n\nType: `object`\n\nSame as `npmName()`.\n\n## Known limitations\n\nThis package checks the npm registry to see if a name is already taken. It also makes a best-effort attempt to detect names that npm blocks at publish time for differing from an existing package only by punctuation (`-`, `.`, `_`): the registry strips punctuation from both names before comparing them. The detection tries the spellings that share the name's own word boundaries, so `ch-alk` and `lodash-merge` are reported as unavailable because `chalk` and `lodash.merge` exist, but it does not enumerate every possible spelling: `validate-io.string-primitive` is reported as available even though the registry blocks it, because `validate.io-string-primitive` exists with different boundaries.\n\nA name with no punctuation can also conflict with an existing punctuated one, for example `lodashmerge` against `lodash.merge`. That direction cannot be enumerated from the client, as there is no way to ask the registry which existing names strip down to a given string.\n\nHowever, npm also performs additional undocumented [similarity checks](https://blog.npmjs.org/post/168978377570/new-package-moniker-rules.html) server-side that may still reject a name at publish time even if this package reports it as available. There is no public API to replicate these checks.\n\n## Related\n\n- [npm-name-cli](https://github.com/sindresorhus/npm-name-cli) - CLI for this module\n","publish_time":1786878807641,"_cnpm_publish_time":1786878807641,"dist-tags":{"latest":"8.1.1"}}