{"name":"@envelop/parser-cache","version":"6.0.2-alpha-20230814184512-d1dba2fd","sideEffects":false,"peerDependencies":{"@envelop/core":"4.0.1-alpha-20230814184512-d1dba2fd","graphql":"^14.0.0 || ^15.0.0 || ^16.0.0"},"dependencies":{"lru-cache":"^10.0.0","tslib":"^2.5.0"},"repository":{"type":"git","url":"git+https://github.com/n1ru4l/envelop.git","directory":"packages/plugins/parser-cache"},"author":{"name":"Dotan Simha","email":"dotansimha@gmail.com"},"license":"MIT","engines":{"node":">=16.0.0"},"main":"cjs/index.js","module":"esm/index.js","typings":"typings/index.d.ts","typescript":{"definition":"typings/index.d.ts"},"type":"module","exports":{".":{"require":{"types":"./typings/index.d.cts","default":"./cjs/index.js"},"import":{"types":"./typings/index.d.ts","default":"./esm/index.js"},"default":{"types":"./typings/index.d.ts","default":"./esm/index.js"}},"./*":{"require":{"types":"./typings/*.d.cts","default":"./cjs/*.js"},"import":{"types":"./typings/*.d.ts","default":"./esm/*.js"},"default":{"types":"./typings/*.d.ts","default":"./esm/*.js"}},"./package.json":"./package.json"},"readme":"## `@envelop/parser-cache`\n\nThis plugins adds simple LRU caching to your `parse`, to improve performance by caching the parsed\nresult.\n\nThis plugins improves performance of parsing by ~60% (based on benchmarks).\n\n## Getting Started\n\n```\nyarn add @envelop/parser-cache\n```\n\n## Usage Example\n\n```ts\nimport { execute, parse, specifiedRules, subscribe, validate } from 'graphql'\nimport { envelop, useEngine } from '@envelop/core'\nimport { useParserCache } from '@envelop/parser-cache'\n\nconst getEnveloped = envelop({\n  plugins: [\n    useEngine({ parse, validate, specifiedRules, execute, subscribe }),\n    // ... other plugins ...\n    useParserCache({\n      // options goes here\n    })\n  ]\n})\n```\n\n### API Reference\n\n#### `documentCache`\n\nSet this to pass in a cache instance for caching documents. By default a new LRU cache is created\nusing default `max` and `ttl`.\n\n#### `errorCache`\n\nSet this to pass in a cache instance for caching errors. By default a new LRU cache is created using\ndefault `max` and `ttl`.\n","readmeFilename":"README.md","description":"This plugins adds simple LRU caching to your `parse`, to improve performance by caching the parsed result.","bugs":{"url":"https://github.com/n1ru4l/envelop/issues"},"homepage":"https://github.com/n1ru4l/envelop#readme","_id":"@envelop/parser-cache@6.0.2-alpha-20230814184512-d1dba2fd","_integrity":"sha512-iJo8l/lknU5EVF2SzD9gb4PXvY2VjzpIPlrmDimtpJBx27OhuTFvg788c5DDHJqyjhxK/gOmiqaC9cNt9nBpxQ==","_resolved":"/tmp/74a874dc27719328863b5e715d397113/envelop-parser-cache-6.0.2-alpha-20230814184512-d1dba2fd.tgz","_from":"file:envelop-parser-cache-6.0.2-alpha-20230814184512-d1dba2fd.tgz","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-iJo8l/lknU5EVF2SzD9gb4PXvY2VjzpIPlrmDimtpJBx27OhuTFvg788c5DDHJqyjhxK/gOmiqaC9cNt9nBpxQ==","shasum":"618bc77b1b5ab25a7dee0b01916435362fd239a5","tarball":"http://registry-npm.ywwl.com/@envelop/parser-cache/download/@envelop/parser-cache-6.0.2-alpha-20230814184512-d1dba2fd.tgz","fileCount":8,"unpackedSize":7325,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvVU+Ctd3N1/iFF/Drf20zD1PSf+MIxZM2PtYMkPpa1gIhAPGmSERZv8R19HL8PrAifADALAVT7qW2dmorYVdDCKq2"}],"size":2457,"noattachment":false,"key":"/@envelop/parser-cache/-/@envelop/parser-cache-6.0.2-alpha-20230814184512-d1dba2fd.tgz"},"_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"directories":{},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parser-cache_6.0.2-alpha-20230814184512-d1dba2fd_1692038785620_0.4180389177634576"},"_hasShrinkwrap":false,"publish_time":1692038785841,"_cnpm_publish_time":1692038785841,"dist-tags":{"alpha":"11.0.2-alpha-20261126100851-58d9782f151a975e802f1a545a315263d8d886a7","latest":"11.0.1","rc":"11.0.2-rc-20261124205929-9595907fc2bef8a397343bd288fef4685ab9f508"}}