{"name":"@cspell/strong-weak-map","version":"6.29.3","keywords":["Map","WeakMap","Weak","Values"],"author":{"name":"Jason Dent","email":"jason@streetsidesoftware.nl"},"license":"MIT","_id":"@cspell/strong-weak-map@6.29.3","homepage":"https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-strong-weak-map#readme","bugs":{"url":"https://github.com/streetsidesoftware/cspell"},"dist":{"shasum":"faec08d088e5b7401f56644df02060a9b0e711d4","tarball":"http://registry-npm.ywwl.com/@cspell/strong-weak-map/download/@cspell/strong-weak-map-6.29.3.tgz","fileCount":11,"integrity":"sha512-+dc3pUsZY2lrtmosDJt4UlOGZDWyzCFnBJyMJ3uYADr+mBBaY4SILDPsTMOBrUHM3qrdft/TUKyLX4XxalAjPw==","signatures":[{"sig":"MEUCIQC+8Ha4+rrFPrr9pystA5AK8W8eL/+PlphED748R9QiOQIgZcVeRwZdek0wemONQOVhOZVOjqtH9l5ax7kuZawhWkg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEBKrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpB5A//dp+mMQRnBiUxpaQp5GRE6mwpjq591Xq0fKuiytYT9MFL39HM\r\n9Pwb7fl3a+F3JusSDz7wvuleoJgi/Guv5Dfxk6LGHQZEpAW7NhCV78vCH74V\r\nIt8zaCgQInVJxERPuxRpEZlq1GT9qhGX3GKmXzdJ2awTqwi5Ji1vSWbo0f26\r\nRuMqB7bEQcmHwK1YHUyZy0tDwA7x3HUd5d4P1Am6r1So5iYvSbUkex8+PHrP\r\np3pkJLjNbazUH3KhCTQ0I3T/F/hKggxsMzsO3yA8LXC13UhxjWywbzVYQM1r\r\nDUeEi0a++MS56NJt1UZQeV757DPP1WjLznBAa5B2wOxJYyYPapNZJNDSwXOL\r\nIi3P1uyTl75IydjjaGcOv0wV2OtEpMnQsKxSSDspguwHO3uz57E++xDI/7QF\r\nJ8A9/f8UP2IdAPUMPZyLF7h8qL7jc4XyMXxXqwfEECcS0li4T4DQWb1aRo9j\r\nrAKXXJfv/ouwIuB+49LB/DNPXX5vRLMaTJhdjWQDNlDtOtEXaO3/dBnGAUm+\r\nEk6t4yTh6+FPjLG21D7lXJVpcpMskHHfV3d6lNDPRzuPNOM8Ew20N8R0G1Do\r\nIiD04NNj6+7nkcRICK1+IgQffdEUQmalBg83/TqNRDj5hReSUKmRz7V5o4RW\r\nhKpL/9B3ie9lREs8f7bf2wDvYSuqtQ+uvOQ=\r\n=HAxu\r\n-----END PGP SIGNATURE-----\r\n","size":4015,"noattachment":false,"key":"/@cspell/strong-weak-map/-/@cspell/strong-weak-map-6.29.3.tgz"},"main":"dist/cjs/index.js","type":"commonjs","module":"dist/esm/index.mjs","engines":{"node":">=14.6"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.js"}},"gitHead":"a46e27dd5e9d52d83f0bfdbeeafcda58ca516fc1","scripts":{"test":"pnpm vitest run","build":"tsc -b . && ts2mjs dist/esm","clean":"shx rm -rf dist coverage .tsbuildinfo","watch":"tsc -b . -w","vitest":"node --expose-gc ../../node_modules/vitest/vitest.mjs","coverage":"pnpm coverage:vitest && pnpm coverage:fix","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","test-watch":"pnpm vitest","clean-build":"pnpm run clean && pnpm run build","coverage:fix":"nyc report --temp-dir \"$(pwd)/coverage\" --reporter lcov --report-dir \"$(pwd)/coverage\" --cwd ../..","coverage:vitest":"pnpm vitest run --coverage"},"typings":"dist/cjs/index.d.ts","_npmUser":{"name":"jason-dent","email":"jason@streetsidesoftware.nl"},"repository":{"url":"git+https://github.com/streetsidesoftware/cspell.git","type":"git"},"_npmVersion":"lerna/1.16.1/node@v18.14.2+x64 (linux)","description":"A Map with weakly referenced values.","directories":{},"_nodeVersion":"18.14.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/strong-weak-map_6.29.3_1678774955188_0.2558756961346067","host":"s3://npm-registry-packages"},"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":1678774955405,"maintainers":[{"name":"jason-dent","email":"jason@streetsidesoftware.nl"}],"_cnpm_publish_time":1678774955405,"dist-tags":{"latest":"10.4.1","next":"10.4.0-alpha.1"}}