{"_id":"is-git-ref-name-valid","_rev":"4170357","name":"is-git-ref-name-valid","description":"Check that a git reference name is well formed","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"vweevers","email":""}],"time":{"modified":"2026-03-01T21:13:48.000Z","created":"2020-11-28T17:59:56.307Z","1.0.0":"2020-11-28T17:59:56.307Z"},"users":{},"author":{"name":"Vincent Weevers"},"repository":{"type":"git","url":"git+https://github.com/vweevers/is-git-ref-name-valid.git"},"versions":{"1.0.0":{"name":"is-git-ref-name-valid","version":"1.0.0","description":"Check that a git reference name is well formed","license":"MIT","author":{"name":"Vincent Weevers"},"scripts":{"test":"standard && nyc node test.js"},"dependencies":{},"devDependencies":{"nyc":"^15.1.0","standard":"^16.0.3","tape":"^5.0.1"},"repository":{"type":"git","url":"git+https://github.com/vweevers/is-git-ref-name-valid.git"},"homepage":"https://github.com/vweevers/is-git-ref-name-valid","keywords":["git","ref","reference","refname"],"engines":{"node":">=10"},"gitHead":"8be4789f7383915f818083eb91d01497dcdaf604","bugs":{"url":"https://github.com/vweevers/is-git-ref-name-valid/issues"},"_id":"is-git-ref-name-valid@1.0.0","_nodeVersion":"12.11.1","_npmVersion":"6.11.3","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"name":"vweevers","email":""}],"dist":{"shasum":"6e151779357dd4f7888e1a83a07db329e3de119d","size":1937,"noattachment":false,"key":"/is-git-ref-name-valid/-/is-git-ref-name-valid-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-git-ref-name-valid/download/is-git-ref-name-valid-1.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-git-ref-name-valid_1.0.0_1606586396163_0.5479408909401966"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-21T21:36:31.587Z","publish_time":1606586396307,"_cnpm_publish_time":1606586396307}},"readme":"# is-git-ref-name-valid\n\n**Check that a git reference name is well formed, per [`git-check-ref-format(1)`](https://git-scm.com/docs/git-check-ref-format).**\n\n[![npm status](http://img.shields.io/npm/v/is-git-ref-name-valid.svg)](https://www.npmjs.org/package/is-git-ref-name-valid)\n[![node](https://img.shields.io/node/v/is-git-ref-name-valid.svg)](https://www.npmjs.org/package/is-git-ref-name-valid)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Usage\n\n```js\nconst validRef = require('is-git-ref-name-valid')\n\nvalidRef('refs/heads/foo.bar') // true\nvalidRef('refs/heads/foo^bar') // false\n```\n\nSame as `git check-ref-format`, the reference name must contain a `/` by default. This can be disabled:\n\n```js\nvalidRef('ünicöde')       // false\nvalidRef('ünicöde', true) // true\n```\n\nTo validate branch names, for which there are additional rules, use [`is-git-branch-name-valid`](https://github.com/vweevers/is-git-branch-name-valid).\n\n## API\n\n### `validRef(name[, onelevel])`\n\nTakes a string `name` and an optional `onelevel` boolean. Returns true if `name` is well formed. Throws if `name` is not a string. If `onelevel` is true then `name` does not have to contain a `/`.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install is-git-ref-name-valid\n```\n\n## License\n\n[MIT](LICENSE) © Vincent Weevers\n","_attachments":{},"homepage":"https://github.com/vweevers/is-git-ref-name-valid","bugs":{"url":"https://github.com/vweevers/is-git-ref-name-valid/issues"},"license":"MIT"}