{"id":20513786,"url":"https://github.com/webreflection/weak-value","last_synced_at":"2025-04-14T00:01:35.819Z","repository":{"id":65993304,"uuid":"276414187","full_name":"WebReflection/weak-value","owner":"WebReflection","description":"A Map with weakly referenced values, instead of keys","archived":false,"fork":false,"pushed_at":"2023-01-27T13:59:41.000Z","size":18,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T03:38:13.101Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebReflection.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}},"created_at":"2020-07-01T15:27:22.000Z","updated_at":"2024-11-04T06:25:36.000Z","dependencies_parsed_at":"2023-03-10T23:27:08.341Z","dependency_job_id":null,"html_url":"https://github.com/WebReflection/weak-value","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"8f53c3f34a9dcfa0b475f9ab5d7cbc60198fd045"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fweak-value","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fweak-value/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fweak-value/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fweak-value/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/weak-value/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799931,"owners_count":21163403,"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-11-15T21:13:08.721Z","updated_at":"2025-04-14T00:01:35.693Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WeakValue\n\n📣 Check out [not-so-weak](https://github.com/WebReflection/not-so-weak) module for better and faster `WValue` alternative\n\n- - -\n\n\n[![Build Status](https://travis-ci.com/WebReflection/weak-value.svg?branch=master)](https://travis-ci.com/WebReflection/weak-value) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/weak-value/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/weak-value?branch=master)\n\nA Map with weakly referenced values, instead of keys, with an optional *onValueCollected* callback to pass aslong.\n\nIn Node.js, it requires [V8 release v8.4](https://v8.dev/blog/v8-release-84) or greater.\n\n```js\nimport WeakValue from 'weak-value';\n// const WeakValue = require('weak-value');\n\nconst wv = new WeakValue;\n\n(() =\u003e {\n  const value = {};\n  wv.set('any-key', value, /* optional */ (key, map) =\u003e {\n    // will log \"any-key value collected\" once GC kicks in\n    console.log(key, 'value collected');\n    console.log(map === wv);  // true\n  });\n})();\n```\n\nPlease note that explicit `wv.delete(key)` will *NOT* invoke *onValueCollected*, as deleting a key does not mean its referenced value has been collected.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fweak-value","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebreflection%2Fweak-value","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fweak-value/lists"}