{"id":17241284,"url":"https://github.com/lassjs/is-valid-npm-name","last_synced_at":"2025-07-31T18:34:51.649Z","repository":{"id":57277705,"uuid":"102820236","full_name":"lassjs/is-valid-npm-name","owner":"lassjs","description":"Checks if a given string is a valid npm package name adhering to npm rules and best practice","archived":false,"fork":false,"pushed_at":"2020-02-20T17:19:20.000Z","size":184,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T03:13:25.093Z","etag":null,"topics":["check","checker","name","node","npm","package","pkg","rules","valid","validator","yarn"],"latest_commit_sha":null,"homepage":"https://lass.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lassjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-08T05:13:04.000Z","updated_at":"2020-01-06T07:23:45.000Z","dependencies_parsed_at":"2022-09-18T15:53:36.117Z","dependency_job_id":null,"html_url":"https://github.com/lassjs/is-valid-npm-name","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lassjs%2Fis-valid-npm-name","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lassjs%2Fis-valid-npm-name/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lassjs%2Fis-valid-npm-name/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lassjs%2Fis-valid-npm-name/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lassjs","download_url":"https://codeload.github.com/lassjs/is-valid-npm-name/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813802,"owners_count":21165634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["check","checker","name","node","npm","package","pkg","rules","valid","validator","yarn"],"created_at":"2024-10-15T06:08:38.703Z","updated_at":"2025-04-14T03:13:30.591Z","avatar_url":"https://github.com/lassjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# is-valid-npm-name\n\n[![build status](https://semaphoreci.com/api/v1/niftylettuce/is-valid-npm-name/branches/master/shields_badge.svg)](https://semaphoreci.com/niftylettuce/is-valid-npm-name)\n[![code coverage](https://img.shields.io/codecov/c/github/lassjs/is-valid-npm-name.svg)](https://codecov.io/gh/lassjs/is-valid-npm-name)\n[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)\n[![license](https://img.shields.io/github/license/lassjs/is-valid-npm-name.svg)](\u003c\u003e)\n\n\u003e Checks if a given string is a valid npm package name adhering to [npm rules](https://docs.npmjs.com/files/package.json#name) and best practice\n\n\n## Table of Contents\n\n* [Install](#install)\n* [Usage](#usage)\n* [Error Strings](#error-strings)\n* [Rule Exemption](#rule-exemption)\n* [Contributors](#contributors)\n* [License](#license)\n\n\n## Install\n\n[npm][]:\n\n```sh\nnpm install is-valid-npm-name\n```\n\n[yarn][]:\n\n```sh\nyarn add is-valid-npm-name\n```\n\n\n## Usage\n\n```js\nconst isValidNpmName = require('is-valid-npm-name');\n\nconst check = isValidNpmName('fs');\n\n// `check` is `true` or a String (e.g. why it was not a valid npm name)\nif (check !== true) {\n  console.error(check);\n  // 'package name cannot use built-in core Node module name'\n}\n```\n\n\n## Error Strings\n\n* package name must be a String\n* remove trailing spaces from start and end of package name\n* package name cannot be more than 214 characters\n* package name cannot start with a dot nor underscore\n* package name cannot have uppercase letters\n* scoped package name must start with \"@\" character\n* scoped package name has an extra \"@\" character\n* scoped package name must be in the format of `@myorg/package`\n* scoped package name has an extra \"/\" character\n* package name cannot use built-in core Node module name\n* package name had non-URL-safe characters\n\n\n## Rule Exemption\n\nWe ignore a single npm rule, which is:\n\n\u003e don't put \"js\" or \"node\" in the name\n\nThis is due to the sheer number of npm package name squatters.\n\nSometimes it's absolutely necessary to affix with `js` or `node`.\n\n\n## Contributors\n\n| Name           | Website                    |\n| -------------- | -------------------------- |\n| **Nick Baugh** | \u003chttp://niftylettuce.com/\u003e |\n\n\n## License\n\n[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)\n\n\n## \n\n[npm]: https://www.npmjs.com/\n\n[yarn]: https://yarnpkg.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flassjs%2Fis-valid-npm-name","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flassjs%2Fis-valid-npm-name","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flassjs%2Fis-valid-npm-name/lists"}