{"id":15314009,"url":"https://github.com/vanruesc/feature-detector","last_synced_at":"2025-10-08T23:32:18.142Z","repository":{"id":57234140,"uuid":"91901882","full_name":"vanruesc/feature-detector","owner":"vanruesc","description":"A tool for detecting environment features.","archived":true,"fork":false,"pushed_at":"2018-08-30T21:44:39.000Z","size":1758,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T09:46:14.593Z","etag":null,"topics":["browser","capabilities","environment","feature-detection","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanruesc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-20T16:27:19.000Z","updated_at":"2023-01-27T21:28:10.000Z","dependencies_parsed_at":"2022-09-05T19:01:04.749Z","dependency_job_id":null,"html_url":"https://github.com/vanruesc/feature-detector","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Ffeature-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Ffeature-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Ffeature-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Ffeature-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanruesc","download_url":"https://codeload.github.com/vanruesc/feature-detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235775518,"owners_count":19043180,"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":["browser","capabilities","environment","feature-detection","nodejs"],"created_at":"2024-10-01T08:44:09.436Z","updated_at":"2025-10-08T23:32:12.680Z","avatar_url":"https://github.com/vanruesc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Feature Detector\n\n[![Build status](https://travis-ci.org/vanruesc/feature-detector.svg?branch=master)](https://travis-ci.org/vanruesc/feature-detector)\n[![npm version](https://badge.fury.io/js/feature-detector.svg)](http://badge.fury.io/js/feature-detector)\n[![Dependencies](https://david-dm.org/vanruesc/feature-detector.svg?branch=master)](https://david-dm.org/vanruesc/feature-detector)\n\nAn extensible tool for detecting environment features such as\n[WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API) or\n[Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).\n\n*[API Reference](http://vanruesc.github.io/feature-detector/docs)*\n\n\n## Installation\n\n```sh\nnpm install feature-detector\n``` \n\n\n## Usage\n\n##### Basics\n\n```javascript\nimport { Detector, FeatureId } from \"feature-detector\";\n\nconst detector = new Detector();\nconst feature = detector.get(FeatureId.WEBGL);\n\nconsole.log(feature.supported);\nconsole.log(detector.getMessage(feature));\n```\n\n##### Custom Features\n\n```javascript\nimport { Feature } from \"feature-detector\";\n\nexport class MyFeature extends Feature {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.name = \"My Feature\";\n\n\t\t// Check if your feature is supported in this environment.\n\t\t// Note that this.root serves as a reference to the global scope.\n\t\tthis.supported = true || false;\n\n\t}\n\n}\n```\n\n```javascript\nimport { Detector } from \"feature-detector\";\nimport { MyFeature } from \"./MyFeature.js\";\n\nconst detector = new Detector();\nconst MY_ID = \"my-feature\";\n\ndetector.set(MY_ID, new MyFeature());\n```\n\n\n## Contributing\n\nMaintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanruesc%2Ffeature-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanruesc%2Ffeature-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanruesc%2Ffeature-detector/lists"}