{"_id":"@cspell/strong-weak-map@10.4.0","bugs":{"url":"https://github.com/streetsidesoftware/cspell/issues?q=is%3Aissue%20state%3Aopen%20label%3Acspell-strong-weak-map"},"dist":{"shasum":"f05ebb866a3d491eb2a76b6bd07da18c62df71e8","tarball":"http://registry-npm.ywwl.com/@cspell/strong-weak-map/download/@cspell/strong-weak-map-10.4.0.tgz","fileCount":7,"integrity":"sha512-y8+Hk90mA3UY4HYEWBJokvNcixQOKkRDLEr+yXSYyOJnt6MhAu8D7N567HjEVNj0e7oirXl62wpNglPfo7qAcQ==","signatures":[{"sig":"MEUCIBTGB88wgz3ZI1iDkFUKOjZFCgQRS1+fcBakwB+ynVxnAiEA6CQGc5xpXJhgFmWMUo4L3JCU8qMH8NcWQSI+B2T4Ju4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD/kYJG60/Nx2GrJEYdchLv25mFwdehgBjGEaSDi8MJZAIgNZjV2QpqG4SbgGwRddaDyLr/eReBm0cEGWbLAOp1KUo="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cspell%2fstrong-weak-map@10.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10752,"size":3700,"noattachment":false,"key":"/@cspell/strong-weak-map/-/@cspell/strong-weak-map-10.4.0.tgz"},"name":"@cspell/strong-weak-map","type":"module","author":{"name":"Jason Dent","email":"jason@streetsidesoftware.nl"},"module":"dist/esm/index.js","engines":{"node":">=22.18.0"},"exports":{".":{"import":"./dist/esm/index.js"}},"gitHead":"7e2bbb5e866c827ac5d2cf6b84bf3e1a016d0823","license":"MIT","scripts":{"test":"pnpm vitest run","build":"tsc -b . -f","clean":"shx rm -rf dist temp coverage \"*.tsbuildInfo\"","watch":"tsc -b . -w -f","vitest":"node --expose-gc ../../node_modules/vitest/vitest.mjs --pool threads","coverage":"pnpm run vitest run --coverage","build:esm":"tsc -p tsconfig.esm.json","test-watch":"pnpm vitest","clean-build":"pnpm run clean && pnpm run build"},"typings":"dist/esm/index.d.ts","version":"10.4.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"a6ea33b9-8939-48f7-beed-e8243af58035"}},"homepage":"https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-strong-weak-map#readme","keywords":["Map","WeakMap","Weak","Values"],"repository":{"url":"git+https://github.com/streetsidesoftware/cspell.git","type":"git","directory":"packages/cspell-strong-weak-map"},"_npmVersion":"lerna/5.6.2/node@v24.21.0+x64 (linux)","description":"A Map with weakly referenced values.","directories":{},"maintainers":[{"name":"jason-dent","email":"jason@streetsidesoftware.nl"}],"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/strong-weak-map_10.4.0_1791970182778_0.330735615516917"},"readme":"# `@cspell/strong-weak-map`\n\nA Map with weakly referenced values.\n\nJavaScript [WeakMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) provides weak keys and strong values.\n\n`StrongWeakMap` allows for strong keys and weak values while providing the same API as [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map).\n\n## Install\n\n```sh\nnpm install -S @cspell/strong-weak-map\n```\n\n## Usage\n\nTypeScript Example: Simple text file reader.\n\n```ts\nimport { StrongWeakMap } from '@cspell/strong-weak-map';\nimport { promises as fs } from 'fs';\n\nconst cache = new StrongWeakMap<string, Promise<string>>();\n\nexport function readTextFile(filename: string, encoding: BufferEncoding = 'utf8'): Promise<string> {\n  const cached = cache.get(filename);\n  if (cached) return cached;\n\n  const content = fs.readFile(filename, encoding);\n\n  cache.set(filename, content);\n\n  return content;\n}\n```\n\nThe above example will reuse the promise as long as it has not been cleaned up by the Garbage Collector.\n\n## API\n\nSee: [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)\n\n<!--- @@inject: ../../static/footer.md --->\n\n<br/>\n\n---\n\n<p align=\"center\">Brought to you by<a href=\"https://streetsidesoftware.com\" title=\"Street Side Software\"><img width=\"16\" alt=\"Street Side Software Logo\" src=\"https://i.imgur.com/CyduuVY.png\" /> Street Side Software</a></p>\n\n<!--- @@inject-end: ../../static/footer.md --->\n","publish_time":1791970182873,"_cnpm_publish_time":1791970182873,"dist-tags":{"latest":"10.4.1","next":"10.4.0-alpha.1"}}