{"id":15814174,"url":"https://github.com/stevenvachon/robot-directives","last_synced_at":"2026-03-03T18:03:47.981Z","repository":{"id":54270698,"uuid":"48260426","full_name":"stevenvachon/robot-directives","owner":"stevenvachon","description":"Parse robot directives within HTML meta and/or HTTP headers.","archived":false,"fork":false,"pushed_at":"2021-02-28T00:08:46.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T07:52:54.986Z","etag":null,"topics":["attributes","headers","html","http","nodejs","robots","seo"],"latest_commit_sha":null,"homepage":"","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/stevenvachon.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":"2015-12-18T23:05:51.000Z","updated_at":"2024-03-27T14:26:24.000Z","dependencies_parsed_at":"2022-08-13T10:31:26.283Z","dependency_job_id":null,"html_url":"https://github.com/stevenvachon/robot-directives","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stevenvachon/robot-directives","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Frobot-directives","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Frobot-directives/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Frobot-directives/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Frobot-directives/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenvachon","download_url":"https://codeload.github.com/stevenvachon/robot-directives/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Frobot-directives/sbom","scorecard":{"id":852723,"data":{"date":"2025-08-11","repo":{"name":"github.com/stevenvachon/robot-directives","commit":"ac5fad412a14b02a18d5a8f396fb31bddb583fe4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T22:56:54.349Z","repository_id":54270698,"created_at":"2025-08-23T22:56:54.349Z","updated_at":"2025-08-23T22:56:54.349Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30054014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T17:46:22.538Z","status":"ssl_error","status_checked_at":"2026-03-03T17:46:22.036Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["attributes","headers","html","http","nodejs","robots","seo"],"created_at":"2024-10-05T04:23:21.358Z","updated_at":"2026-03-03T18:03:47.964Z","avatar_url":"https://github.com/stevenvachon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# robot-directives [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url]\n\n\u003e Parse robot directives within HTML meta and/or HTTP headers.\n\n* `\u003cmeta name=\"robots\" content=\"noindex,nofollow\"\u003e`\n* `X-Robots-Tag: noindex,nofollow`\n* etc\n\nNote: this library is not responsible for parsing any HTML.\n\n\n## Installation\n\n[Node.js](https://nodejs.org) `\u003e= 14` is required. To install, type this at the command line:\n```shell\nnpm install robot-directives\n```\n\n## Usage\n```js\nconst RobotDirectives = require('robot-directives');\n\nconst robots = new RobotDirectives(options)\n  .header('googlebot: noindex')\n  .meta('bingbot', 'unavailable_after: 1-Jan-3000 00:00:00 EST')\n  .meta('robots', 'noarchive,nocache,nofollow');\n\nrobots.is(RobotDirectives.NOFOLLOW);\n//-\u003e true\n\nrobots.is([ RobotDirectives.NOFOLLOW, RobotDirectives.FOLLOW ]);\n//-\u003e false\n\nrobots.isNot([ RobotDirectives.ARCHIVE, RobotDirectives.FOLLOW ]);\n//-\u003e true\n\nrobots.is(RobotDirectives.NOINDEX, {\n  currentTime: () =\u003e new Date('jan 1 3001').getTime(),\n  userAgent: 'Bingbot/2.0'\n});\n//-\u003e true\n\nRobotDirectives.isBot('googlebot');\n//-\u003e true\n```\n\n\n## Constants\nFor use in comparison, the following directives are available as static properties on the constructor:\n* `ALL`\n* `ARCHIVE`\n* `CACHE`\n* `FOLLOW`\n* `IMAGEINDEX`\n* `INDEX`\n* `NOARCHIVE`\n* `NOCACHE`\n* `NOFOLLOW`\n* `NOIMAGEINDEX`\n* `NOINDEX`\n* `NONE`\n* `NOODP`\n* `NOSNIPPET`\n* `NOTRANSLATE`\n* `ODP`\n* `SNIPPET`\n* `TRANSLATE`\n\n\n## Methods\n\n### `header(value)`\nParses, stores and cascades the value of an `X-Robots-Tag` HTTP header.\n\n### `is(directive[, options])`\nValidates a directive or a list of directives against parsed instructions. `directive` can be a `String` or an `Array`. `options`, if defined, will override any such defined in the constructor during instantiation. A value of `true` is returned if all directives are valid.\n\n### `isNot(directive[, options])`\nInversion of `is()`. A value of `true` is returned if all directives are *not* valid.\n\n### `meta(name, content)`\nParses, stores and cascades the data within a `\u003cmeta\u003e` HTML element.\n\n### `oneIs(directives[, options])`\nA variation of `.is()`. A value of `true` is returned if at least one directive is valid.\n\n### `oneIsNot(directives[, options])`\nInversion of `oneIs()`. A value of `true` is returned if at least one directive is *not* valid.\n\n\n## Functions\n\n### `isBot(botname)`\nReturns `true` if `botname` is a valid bot/crawler/spider name or user-agent.\n\n\n## Options\n\n### `allIsReadonly`\nType: `Boolean`  \nDefault value: `true`  \nDeclaring the `'all'` directive will not affect other directives when `true`. This is how most search crawlers perform.\n\n### `currentTime`\nType: `Function`  \nDefault value: `function(){ return Date.now() }`  \nThe date to use when checking if `unavailable_after` has expired.\n\n### `restrictive`\nType: `Boolean`  \nDefault value: `true`  \nDirective conflicts will be resolved by selecting the most restrictive value. Example: `'noindex,index'` will resolve to `'noindex'` because it is more restrictive. This is how Googlebot behaves, but others may differ.\n\n### `userAgent`\nType: `String`  \nDefault value: `''`  \nThe HTTP user-agent to use when retrieving instructions via `is()` and `isNot()`.\n\n\n[npm-image]: https://img.shields.io/npm/v/robot-directives.svg\n[npm-url]: https://npmjs.com/package/robot-directives\n[travis-image]: https://img.shields.io/travis/stevenvachon/robot-directives.svg\n[travis-url]: https://travis-ci.org/stevenvachon/robot-directives\n[coveralls-image]: https://img.shields.io/coveralls/stevenvachon/robot-directives.svg\n[coveralls-url]: https://coveralls.io/github/stevenvachon/robot-directives\n[david-image]: https://img.shields.io/david/stevenvachon/robot-directives.svg\n[david-url]: https://david-dm.org/stevenvachon/robot-directives\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Frobot-directives","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenvachon%2Frobot-directives","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Frobot-directives/lists"}