{"id":17335481,"url":"https://github.com/vigneshshanmugam/elements-kinds","last_synced_at":"2025-03-27T07:12:58.457Z","repository":{"id":72802873,"uuid":"126253017","full_name":"vigneshshanmugam/elements-kinds","owner":"vigneshshanmugam","description":"JS helper function to debug elements kinds in v8","archived":false,"fork":false,"pushed_at":"2018-03-22T08:18:10.000Z","size":9,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T12:11:18.278Z","etag":null,"topics":["elements-kinds","holey","packed","v8"],"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/vigneshshanmugam.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-21T23:31:48.000Z","updated_at":"2024-04-28T02:48:56.000Z","dependencies_parsed_at":"2023-06-06T05:45:49.200Z","dependency_job_id":null,"html_url":"https://github.com/vigneshshanmugam/elements-kinds","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vigneshshanmugam%2Felements-kinds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vigneshshanmugam%2Felements-kinds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vigneshshanmugam%2Felements-kinds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vigneshshanmugam%2Felements-kinds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vigneshshanmugam","download_url":"https://codeload.github.com/vigneshshanmugam/elements-kinds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245798359,"owners_count":20673902,"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":["elements-kinds","holey","packed","v8"],"created_at":"2024-10-15T15:10:09.903Z","updated_at":"2025-03-27T07:12:58.404Z","avatar_url":"https://github.com/vigneshshanmugam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elements-kinds\n\nJS helper function to debug elements kinds in v8\n\nMore details in this [blogpost](https://v8project.blogspot.de/2017/09/elements-kinds-in-v8.html) by Mathias Bynes\n\n**DISCLAMIER: This module is not 100% correct, Its just a reference implementation in JavaScript.**\n\nAny JS only implementation can only guess what the elements kind is. The proper way of finding out is to get the debug build of d8 and in the REPL use the special `%DebugPrint(object)` function.\n\n```sh\n$ out.gn/x64.debug/d8 --allow-natives-syntax\n\nd8\u003e const array = [1, 2, 3]; %DebugPrint(array);\nDebugPrint: 0x1fbbad30fd71: [JSArray]\n - map = 0x10a6f8a038b1 [FastProperties]\n - prototype = 0x1212bb687ec1\n - elements = 0x1fbbad30fd19 \u003cFixedArray[3]\u003e [PACKED_SMI_ELEMENTS (COW)]\n - length = 3\n - properties = 0x219eb0702241 \u003cFixedArray[0]\u003e {\n    #length: 0x219eb0764ac9 \u003cAccessorInfo\u003e (const accessor descriptor)\n }\n - elements= 0x1fbbad30fd19 \u003cFixedArray[3]\u003e {\n           0: 1\n           1: 2\n           2: 3\n }\n```\n\n### Installation\n\n```sh\nyarn add elements-kinds\n\n// npm\nnpm install elements-kinds\n```\n\n### Usage\n\n```js\nconst getElementsKinds = require(\"elements-kinds\");\n\nconsole.log(getElementsKinds(new Array(12));\n// HOLEY_SMI_ELEMENTS\nconsole.log(getElementsKinds([1, 2, \"1\", \"3\", 1.21]));\n// PACKED_ELEMENTS\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvigneshshanmugam%2Felements-kinds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvigneshshanmugam%2Felements-kinds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvigneshshanmugam%2Felements-kinds/lists"}