{"id":13512010,"url":"https://github.com/ruanyf/es-checker","last_synced_at":"2025-05-16T02:09:57.706Z","repository":{"id":34324381,"uuid":"38243237","full_name":"ruanyf/es-checker","owner":"ruanyf","description":"A feature detection library for ECMAScript in node.js and browser.","archived":false,"fork":false,"pushed_at":"2019-07-16T13:38:38.000Z","size":576,"stargazers_count":1019,"open_issues_count":0,"forks_count":152,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-05-08T16:17:34.822Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://ruanyf.github.io/es-checker","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruanyf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-29T11:02:58.000Z","updated_at":"2025-03-05T02:46:33.000Z","dependencies_parsed_at":"2022-06-27T11:21:34.805Z","dependency_job_id":null,"html_url":"https://github.com/ruanyf/es-checker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyf%2Fes-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyf%2Fes-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyf%2Fes-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyf%2Fes-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruanyf","download_url":"https://codeload.github.com/ruanyf/es-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453667,"owners_count":22073618,"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":[],"created_at":"2024-08-01T03:01:24.848Z","updated_at":"2025-05-16T02:09:57.665Z","avatar_url":"https://github.com/ruanyf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Uncategorized","工具库"],"sub_categories":["Uncategorized"],"readme":"ES-Checker is a feature detection library for ECMAScript in node.js and browser. Please visit [demo](http://ruanyf.github.io/es-checker/).\n\n## How to use\n\n### Command line\n\n```bash\n$ npm install -g es-checker\n$ es-checker\n```\n\n![](./screenshot.png)\n\n### Node.js\n\nFirst install es-checker locally.\n\n```bash\n$ npm install --save es-checker\n```\n\nThen require it in your script.\n\n```javascript\nvar Supports = require(\"es-checker\");\n\nif (Supports.letConst) {\n  let x = 5;\n} else {\n  var x = 5;\n}\n```\n\nThe whole Api List please [see below](#api).\n\n### Browser\n\nFirst insert es-checker.js into your page.\n\n```html\n\u003cscript src=\"http://ruanyf.github.io/es-checker/es-checker.js\"\u003e\u003c/script\u003e\n```\n\nThen use `Supports` to decide which feature to use. Visit [demo](http://ruanyf.github.io/es-checker/).\n\n```html\n\u003cscript\u003e\nif (Supports.letConst) {\n  let x = 5;\n} else {\n  var x = 5;\n}\n\u003c/script\u003e\n```\n\nThe whole API List please [see below](#api).\n\n## API\n\nThis library is derived from [es-feature-tests](https://github.com/getify/es-feature-tests). The following API is copied from it. Visit [FeatureTests.io](https://featuretests.io/details) for more information, including how to test a feature by yourself.\n\n- **letConst**: let and const\n- **defaultParameter**: default function parameter values\n- **spreadRest**: ... operator\n- **destructuring**: destructuring assignments/declarations for arrays and objects\n- **parameterDestructuring**: destructuring for function parameters\n- **templateString**: `..` Template String Literals\n- **forOf**: for (var v of something) { .. }\n- **arrow**: x =\u003e x * x\n- **generator**: function *foo() { .. }\n- **conciseMethodProperty**: o = { b() { .. }, a }\n- **computedProperty**: o = { [\"a\" + \"b\"]: 42 }\n- **moduleExport**: In modules, export default foo = 42\n- **moduleImport**: In modules, import bar from \"foo\"\n- **class**: class A extends B { .. }\n- **numericLiteral**: Octal and binary literal forms (0o1, 0b10)\n- **oldOctalLiteral**: Old octal literal invalid now (01)\n- **symbol**: Symbol primitive\n- **unicodeEscape**: Unicode code-point escape form in string literals ('\\u{20BB7}')\n- **unicodeIdentifier**: Unicode code-point escape form in identifier names (\\u{20BB7} = 42)\n- **unicodeRegExp**: Unicode code-point escape form in regular expressions (/\\u{20BB7}/u)\n- **stickyRegExp**: y flag for sticky regular expressions\n- **letTDZ**: TDZ error for too-early access of let or const declarations\n- **constRedef**: Redefinition of const declarations not allowed\n- **objectProto**: __proto__ in object literal definition sets [[Prototype]] link\n- **objectSuper**: super allowed in object methods\n- **extendNatives**: class ABC extends Array { .. }\n- **tco**: Tail-call optimization for function calls and recursion\n- **symbolImplicitCoercion**: Symbols can't be implicitly coerced (Symbol(\"a\") + \"\")\n- **functionNameInfernece**: Inferences for function name property for anonymous functions\n- **objectStatics**: Static functions added to Object\n- **arrayStatics**: Static functions added to Array\n- **arrayMethods**: Methods added to Array.prototype\n- **typedArrays**: TypedArrays like Uint8Array (technically a web platform feature long before ES6)\n- **typedArrayStatics**: Some Array statics (like from(..)) added to the TypedArray constructors\n- **typedArrayMethods**: Some Array methods (like map(..)) added to the TypedArray prototypes\n- **stringMethods**: Methods added to String.prototype\n- **numberStatics**: Static functions added to Number\n- **mathStatics**: Static functions added to Math\n- **collections**: Collections added (Map, Set, WeakMap, WeakSet)\n- **proxy**: Proxies\n- **promise**: Promises\n- **reflect**: Reflect\n\n## Licensed\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanyf%2Fes-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruanyf%2Fes-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanyf%2Fes-checker/lists"}