{"id":17048694,"url":"https://github.com/neocotic/featuring","last_synced_at":"2026-04-17T12:31:36.392Z","repository":{"id":57234174,"uuid":"90368144","full_name":"neocotic/featuring","owner":"neocotic","description":"Simple lightweight immutable feature toggle implementation","archived":false,"fork":false,"pushed_at":"2018-11-23T15:52:10.000Z","size":190,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-31T07:27:43.715Z","etag":null,"topics":["browser","feature-flag","feature-toggle","javascript","nodejs"],"latest_commit_sha":null,"homepage":null,"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/neocotic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-05T11:15:07.000Z","updated_at":"2018-11-23T15:51:23.000Z","dependencies_parsed_at":"2022-09-05T21:10:53.354Z","dependency_job_id":null,"html_url":"https://github.com/neocotic/featuring","commit_stats":null,"previous_names":["notninja/featuring"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/neocotic/featuring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocotic%2Ffeaturing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocotic%2Ffeaturing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocotic%2Ffeaturing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocotic%2Ffeaturing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neocotic","download_url":"https://codeload.github.com/neocotic/featuring/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocotic%2Ffeaturing/sbom","scorecard":{"id":102791,"data":{"date":"2025-08-04","repo":{"name":"github.com/neocotic/featuring","commit":"ac03a89119c9862f181baa3f4b581e9805065d16"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":2.1,"checks":[{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#license"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#cii-best-practices"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"54 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-mh2h-6j8q-x246","Warn: Project is vulnerable to: GHSA-5q88-cjfq-g2mh","Warn: Project is vulnerable to: GHSA-xp63-6vf5-xf3v","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-mh6f-8j2x-4483","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-675m-85rw-j3w4","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T10:30:57.559Z","repository_id":57234174,"created_at":"2025-08-15T10:30:57.559Z","updated_at":"2025-08-15T10:30:57.559Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31929509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T10:35:34.458Z","status":"ssl_error","status_checked_at":"2026-04-17T10:35:09.472Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["browser","feature-flag","feature-toggle","javascript","nodejs"],"created_at":"2024-10-14T09:52:47.415Z","updated_at":"2026-04-17T12:31:36.374Z","avatar_url":"https://github.com/neocotic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"     .d888                  888                     d8b\n    d88P\"                   888                     Y8P\n    888                     888\n    888888 .d88b.   8888b.  888888 888  888 888d888 888 88888b.   .d88b.\n    888   d8P  Y8b     \"88b 888    888  888 888P\"   888 888 \"88b d88P\"88b\n    888   88888888 .d888888 888    888  888 888     888 888  888 888  888\n    888   Y8b.     888  888 Y88b.  Y88b 888 888     888 888  888 Y88b 888\n    888    \"Y8888  \"Y888888  \"Y888  \"Y88888 888     888 888  888  \"Y88888\n                                                                      888\n                                                                 Y8b d88P\n                                                                  \"Y88P\"\n\n[featuring](https://github.com/neocotic/featuring) is a simple lightweight immutable feature toggle JavaScript library.\n\n[![Build Status](https://img.shields.io/travis/neocotic/featuring/develop.svg?style=flat-square)](https://travis-ci.org/neocotic/featuring)\n[![Coverage](https://img.shields.io/codecov/c/github/neocotic/featuring/develop.svg?style=flat-square)](https://codecov.io/gh/neocotic/featuring)\n[![Dev Dependency Status](https://img.shields.io/david/dev/neocotic/featuring.svg?style=flat-square)](https://david-dm.org/neocotic/featuring?type=dev)\n[![License](https://img.shields.io/npm/l/featuring.svg?style=flat-square)](https://github.com/neocotic/featuring/blob/master/LICENSE.md)\n[![Release](https://img.shields.io/npm/v/featuring.svg?style=flat-square)](https://www.npmjs.com/package/featuring)\n\n* [Install](#install)\n* [API](#api)\n* [Bugs](#bugs)\n* [Contributors](#contributors)\n* [License](#license)\n\n## Install\n\nInstall using the package manager for your desired environment(s):\n\n``` bash\n$ npm install --save featuring\n# OR:\n$ bower install --save featuring\n```\n\nWhile equals should be compatible with all versions of [Node.js](https://nodejs.org), it is only tested against version\n4 and above.\n\nIf you want to simply download the file to be used in the browser you can find them below:\n\n* [Development Version](https://unpkg.com/featuring/dist/featuring.js) (15kb - [Source Map](https://unpkg.com/featuring/dist/featuring.js.map))\n* [Production Version](https://unpkg.com/featuring/dist/featuring.min.js) (1.2kb - [Source Map](https://unpkg.com/featuring/dist/featuring.min.js.map))\n\n## API\n\nAll feature names that are passed to the API are case sensitive.\n\n### `Featuring([features])`\n\nEncapsulates the named active `features` provided, allowing them to be queried at any time while preventing them from\nbeing modified.\n\n``` javascript\nvar Featuring = require('featuring');\nvar features = new Featuring([ 'FOO', 'BAR' ]);\n// OR:\nvar featuring = require('featuring');\nvar features = featuring([ 'FOO', 'BAR' ]);\n\nfeatures.active('FOO');\n//=\u003e true\nfeatures.active([ 'FOO', 'BUZZ' ]);\n//=\u003e false\nfeatures.anyActive([ 'FOO', 'BAR' ]);\n//=\u003e true\n\nfeatures.get();\n//=\u003e [ \"FOO\", \"BAR\" ]\n\nfeatures.verify('FOO');\n// ...\nfeatures.verify([ 'FOO', 'BUZZ' ]);\n//=\u003e Error(\"BUZZ\" feature is not active)\nfeatures.verifyAny([ 'FOO', 'BAR' ]);\n// ...\n\nfeatures.when('FOO', function() {\n // ...\n});\nfeatures.when([ 'FOO', 'BUZZ' ], function() {\n // Never called\n});\nfeatures.whenAny([ 'FOO', 'BAR' ], function() {\n // ...\n});\n```\n\n### `Featuring#active([names])`\n\nReturns whether **all** of the named features are active.\n\n``` javascript\nvar features = require('featuring')([ 'FOO', 'BAR' ]);\n\nfeatures.active('FOO');\n//=\u003e true\nfeatures.active('BUZZ');\n//=\u003e false\nfeatures.active([ 'FOO', 'BAR' ]);\n//=\u003e true\nfeatures.active([ 'FOO', 'BUZZ' ]);\n//=\u003e false\nfeatures.active([ 'foo', 'bar' ]);\n//=\u003e false\n\nfeatures.active(null);\n//=\u003e true\nfeatures.active([]);\n//=\u003e true\n```\n\n### `Featuring#anyActive([names])`\n\n**Alias:** `Featuring#active.any`\n\nReturns whether **any** of the named features are active.\n\n``` javascript\nvar features = require('featuring')([ 'FOO', 'BAR' ]);\n\nfeatures.anyActive('FOO');\n//=\u003e true\nfeatures.anyActive('BUZZ');\n//=\u003e false\nfeatures.anyActive([ 'FOO', 'BAR' ]);\n//=\u003e true\nfeatures.anyActive([ 'FOO', 'BUZZ' ]);\n//=\u003e true\nfeatures.anyActive([ 'foo', 'bar' ]);\n//=\u003e false\n\nfeatures.anyActive(null);\n//=\u003e false\nfeatures.anyActive([]);\n//=\u003e false\n```\n\n### `Featuring#get()`\n\nReturns the names of all of the active features.\n\n``` javascript\nvar featuring = require('featuring');\n\nfeaturing([]).get();\n//=\u003e []\nfeaturing('FOO').get();\n//=\u003e [ \"FOO\" ]\nfeaturing([ 'FOO', 'BAR' ]).get();\n//=\u003e [ \"FOO\", \"BAR\" ]\n```\n\n### `Featuring#verify([names])`\n\nVerifies that **all** of the named features are active and throws an error if they are not.\n\nThis method is useful for fail-fast situations where it's best if the code simply breaks when the named features are not\nactive.\n\n``` javascript\nvar features = require('featuring')([ 'FOO', 'BAR' ]);\n\nfeatures.verify('FOO');\n// ...\nfeatures.verify('BUZZ');\n//=\u003e Error(\"BUZZ\" feature is not active)\nfeatures.verify([ 'FOO', 'BAR' ]);\n//=\u003e ...\nfeatures.verify([ 'FOO', 'BUZZ' ]);\n//=\u003e Error(\"BUZZ\" feature is not active)\nfeatures.verify([ 'foo', 'bar' ]);\n//=\u003e Error(\"foo\" feature is not active)\n\nfeatures.verify(null);\n// ...\nfeatures.verify([]);\n// ...\n```\n\n### `Featuring#verifyAny([names])`\n\n**Alias:** `Featuring#verify.any`\n\nVerifies that **any** of the named features are active and throws an error if this is not the case.\n\nThis method is useful for fail-fast situations where it's best if the code simply breaks when none of the named features\nare active.\n\n``` javascript\nvar features = require('featuring')([ 'FOO', 'BAR' ]);\n\nfeatures.verifyAny('FOO');\n// ...\nfeatures.verifyAny('BUZZ');\n//=\u003e Error(All named features are not active)\nfeatures.verifyAny([ 'FOO', 'BAR' ]);\n//=\u003e ...\nfeatures.verifyAny([ 'FOO', 'BUZZ' ]);\n// ...\nfeatures.verifyAny([ 'foo', 'bar' ]);\n//=\u003e Error(All named features are not active)\n\nfeatures.verifyAny(null);\n//=\u003e Error(All named features are not active)\nfeatures.verifyAny([]);\n//=\u003e Error(All named features are not active)\n```\n\n### `Featuring#when([names, ]func)`\n\nInvokes the specified function only when **all** of the named features are active.\n\nThis method is often preferred over using [Featuring#active](#featuringactivenames) within an `if` expression when\nwrapping large code as it helps to prevent potential scoping issues (e.g. from variable hoisting) and can even be\nsimpler to replace with IIFEs, when taking that route.\n\n``` javascript\nvar features = require('featuring')([ 'FOO', 'BAR' ]);\n\nfeatures.when('FOO', function() {\n  // ...\n});\nfeatures.when('BUZZ', function() {\n  // Never called\n});\nfeatures.when([ 'FOO', 'BAR' ], function() {\n  // ...\n});\nfeatures.when([ 'FOO', 'BUZZ' ], function() {\n  // Never called\n});\nfeatures.when([ 'foo', 'bar' ], function() {\n  // Never called\n});\n\nfeatures.when(null, function() {\n  // ...\n});\nfeatures.when([], function() {\n  // ...\n});\n```\n\n### `Featuring#whenAny([names, ]func)`\n\n**Alias:** `Featuring#when.any`\n\nInvokes the specified function only when **any** of the named features are active.\n\nThis method is often preferred over using [Featuring#anyActive](#featuringanyactivenames) within an `if` expression when\nwrapping large code as it helps to prevent potential scoping issues (e.g. from variable hoisting) and can even be\nsimpler to replace with IIFEs, when taking that route.\n\n``` javascript\nvar features = require('featuring')([ 'FOO', 'BAR' ]);\n\nfeatures.whenAny('FOO', function() {\n  // ...\n});\nfeatures.whenAny('BUZZ', function() {\n  // Never called\n});\nfeatures.whenAny([ 'FOO', 'BAR' ], function() {\n  // ...\n});\nfeatures.whenAny([ 'FOO', 'BUZZ' ], function() {\n  // ...\n});\nfeatures.whenAny([ 'foo', 'bar' ], function() {\n  // Never called\n});\n\nfeatures.whenAny(null, function() {\n  // Never called\n});\nfeatures.whenAny([], function() {\n  // Never called\n});\n```\n\n## Bugs\n\nIf you have any problems with featuring or would like to see changes currently in development you can do so\n[here](https://github.com/neocotic/featuring/issues).\n\n## Contributors\n\nIf you want to contribute, you're a legend! Information on how you can do so can be found in\n[CONTRIBUTING.md](https://github.com/neocotic/featuring/blob/master/CONTRIBUTING.md). We want your suggestions and pull\nrequests!\n\nA list of featuring contributors can be found in\n[AUTHORS.md](https://github.com/neocotic/featuring/blob/master/AUTHORS.md).\n\n## License\n\nCopyright © 2018 Alasdair Mercer\n\nSee [LICENSE.md](https://github.com/neocotic/featuring/raw/master/LICENSE.md) for more information on our MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneocotic%2Ffeaturing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneocotic%2Ffeaturing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneocotic%2Ffeaturing/lists"}