{"name":"@cspell/strong-weak-map","version":"7.0.0-alpha.1","keywords":["Map","WeakMap","Weak","Values"],"author":{"name":"Jason Dent","email":"jason@streetsidesoftware.nl"},"license":"MIT","_id":"@cspell/strong-weak-map@7.0.0-alpha.1","homepage":"https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-strong-weak-map#readme","bugs":{"url":"https://github.com/streetsidesoftware/cspell"},"dist":{"shasum":"14a590fa486464fb734b6d057f35381eed531642","tarball":"http://registry-npm.ywwl.com/@cspell/strong-weak-map/download/@cspell/strong-weak-map-7.0.0-alpha.1.tgz","fileCount":11,"integrity":"sha512-ibmNBrWlhoGZD2rT1LbPy2J+cPVyZF/d9lekXB3z85qqoDIPplyxtpZc9c/YSjCoyzHZZZ7EeWZVD2IXpU9m+Q==","signatures":[{"sig":"MEYCIQDanlqULeDdJPGEpsLkMI2Dkwb4tiSEnucYZJOXZ9SLGQIhAM9IgFhii7u2WJUQgNzNUbEDfTkRkNxTrl4ypJqizXiR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOUKXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqu9RAAitO8sqPigoD2iyzCHSiDyat8ya7osFV4zwlVNhx4dfG1jnH5\r\nvbSojqstuk204OX1DOZYvTe3jCb00wDb+6Iu35svanH98cpo4/SEJEn3NM+O\r\nvZVHHQtSfm1nnv0um7U8lgIEK2qHBCBUkJ4ox6KMComoy6irHhRo7LZ0nTG6\r\nhb3vT5bsUbsgtfJ4dnZFgBMurJ1VhWC6HQPWEMRLRegilrT6debA3uVo+EpK\r\n7Ac8gxpcdLTQBFVIczR4Vr9H+XshIS8qYxbh5JRYlV68OOP7EHOgqAiQWFrZ\r\nLcvN5kX5LFaXLYjjj1f87CUgLmPat7uXWJs0jMgyPBxOI7Dg8dASiJi+fOUS\r\nFoMDZdUnbMXl5cUJbDz85o2hhphanJFnjYReyUij6TV7xD9wVWL+TMV9rR5W\r\nP0itxHbp0w3OqLIGfT1iS3rPx1ePsNVfybIHHLluOHXHQscywml7uEpSBg0k\r\ngFkXpBhLHI5CTjSysbtr/AWMHiYkpB5oki/bfwasRjjvVHidWHPVVvfys7ZI\r\n4BSY48j7wTJ5pbFCyq+/Ru/uzLHKnJCfbMhR/4AExTa2KeiXA4bblRVSu1Ap\r\ndDKPy4w1amLCnTez/Uu9W4Q78J76FDppclm0Nfyx8XZrunfYMAX3/e2CsNrq\r\nSdpXGYaKBjRBX6rS/7ZuF3jwGnRRXMT8COQ=\r\n=YM4D\r\n-----END PGP SIGNATURE-----\r\n","size":4018,"noattachment":false,"key":"/@cspell/strong-weak-map/-/@cspell/strong-weak-map-7.0.0-alpha.1.tgz"},"main":"dist/cjs/index.js","type":"commonjs","module":"dist/esm/index.mjs","engines":{"node":">=16"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.js"}},"gitHead":"626d1a01b413c1b6de0b386a5a264b78a10ba146","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.17.0/node@v18.15.0+x64 (linux)","description":"A Map with weakly referenced values.","directories":{},"_nodeVersion":"18.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/strong-weak-map_7.0.0-alpha.1_1681474199256_0.4568479298450805","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":1681474199471,"maintainers":[{"name":"jason-dent","email":"jason@streetsidesoftware.nl"}],"_cnpm_publish_time":1681474199471,"dist-tags":{"latest":"10.4.1","next":"10.4.0-alpha.1"}}