{"_id":"@b2wads/lru-native2","_rev":"15-1208b52bd04dc3cdf9064741e5d534bf","name":"@b2wads/lru-native2","dist-tags":{"latest":"1.2.5-hack"},"versions":{"1.2.4-hack":{"name":"@b2wads/lru-native2","version":"1.2.4-hack","description":"LRU cache module written in C++","keywords":["LRU","cache","native","c++"],"main":"index.js","types":"index.d.ts","maintainers":[{"name":"vitorhnn","email":"victor.chiletto@b2wdigital.com"},{"name":"rockerbacon","email":"vitor.asantos@b2wdigital.com"},{"name":"dehmirandac2","email":"dehmirandac2@gmail.com"},{"name":"lucasdomi","email":"lucasdomi@gmail.com"},{"name":"pabarros","email":"paulo.alfredo.barros@gmail.com"},{"name":"apfzvd","email":"apfzvd@gmail.com"},{"name":"dentxinho","email":"raul_baldner_junior@hotmail.com"},{"name":"george-veras","email":"george.veras.valentim@gmail.com"}],"author":{"name":"Kibae Shin","email":"nonunnet@gmail.com"},"repository":{"type":"git","url":"git://github.com/kibae/node-lru-native.git"},"license":"MIT","dependencies":{"nan":"^2.14.1"},"devDependencies":{"chai":"^4.2.0","mocha":"^8.2.1","tslint-lt":"^1.8.0","typescript":"^3.4.5"},"scripts":{"test":"npm run build && node --expose-gc --trace-gc node_modules/mocha/bin/_mocha -R spec","valgrind":"npm run build && valgrind --leak-check=full --show-possibly-lost=no node --expose-gc --trace-gc node_modules/mocha/bin/_mocha -R spec","build":"node-gyp rebuild","install":"npm run build","lint":"npm run prettier && tslint --format stylish --project .","prettier":"prettier --config node_modules/tslint-lt/.prettierrc.yml --write \"{,!node_modules/}**/*.{ts,tsx,css,scss,html,js,jsx,yml,json}\"","docker":"docker build ."},"gitHead":"b3392ca8bbf7d0650a55ceb2cdddc49850ab7208","bugs":{"url":"https://github.com/kibae/node-lru-native/issues"},"homepage":"https://github.com/kibae/node-lru-native#readme","_id":"@b2wads/lru-native2@1.2.4-hack","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-daEtTgXzCF0wTTIV+NSdZO4tyK+0V2tbOycqEC82p77ikTJym2Vh179K5pSF9GZ8uAU/phBYe2yV2K0y0q/GIA==","shasum":"9c0b2d4db013a2a8a7218fcd1075a28a11916de8","tarball":"https://registry.npmjs.org/@b2wads/lru-native2/-/lru-native2-1.2.4-hack.tgz","fileCount":14,"unpackedSize":19971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwPM2CRA9TVsSAnZWagAAfVQP/37k9VEGOWU4dmIf3hHR\nVD3DpaJgNzA3Pfp1me9yl/YRgYqUH0+VimyrLL0LYrCAYc7I58hA5pqgXH1f\nxyLPnhEdML7u1JMyLAkFUSgI0vhvc6P1EsxpOKKfRpQpVXvtQRQY8KkVQ/7Z\nzxj52tFDPUkBE9SV2RtoYk4dB1xUHrZA1mAloGG8j0OffJOgc7wdNdEJ0vgR\npf+IwQeFFr9jkRfvlEdahX3yP997m5UeQ1VAhRBm6JjrsJbcQCuEKC1/UHSv\niGNInAkL52MYVB0sXGvUtf7XEbWF5BZDZPi7Mki4dB1zzZbbTTr4+CcNKajU\ne+Ep43/A4JC6GGorsxC1a+jYBJvoac/N9M91eXqJOKtR8vpFpcj45ZGUyE9h\ncS/IvtBlZqCSZ0Zzw1iB7SGKPb4LT+fVSbbLehabl46eejrFipF9hJ0GD0S3\nUYMC/X+GApsouxq6u6ovPhT++nb8PPbSZYYaWOK/WD+avcGZ8Cm9kF/2X/IO\nPDsabzAbMhSP63uJzhWMQQqvD1viajIvfxE7O6wmj8ekEgxxhRDRHVbaZLct\nxgsoOcQJ5Lc5dWO0bJqQ+d5InHEwUJtNufGMPR8H0M/jBeqIRSvKGtPHuA+8\nN64GYWTyW+HfwdQcL2/B+PhgMCxd5e5XMIChwnjRquh+Bg0UmJWjJxT6yol0\nrwgQ\r\n=JMp6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxNn9W/FdFJz14DjweKOl8bMGaSMNCYvEYsMdQ/VS7bAIgIA8nK8WRu6IktSybOqX/IGV4rFt1NmJB6a7rLgitSuA="}]},"_npmUser":{"name":"vitorhnn","email":"victor.chiletto@b2wdigital.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lru-native2_1.2.4-hack_1606480693771_0.8444720525421223"},"_hasShrinkwrap":false},"1.2.5-hack":{"name":"@b2wads/lru-native2","version":"1.2.5-hack","description":"LRU cache module written in C++","keywords":["LRU","cache","native","c++"],"main":"index.js","types":"index.d.ts","maintainers":[{"name":"viniciusfariaresende","email":"vinicius.resende@b2wdigital.com"},{"name":"carlosmeloads","email":"carlos.cmelo@b2wdigital.com"},{"name":"gabrielhenriques","email":"gabriel.hssantos@b2wdigital.com"},{"name":"erovereb2w","email":"eduardo.rovere@b2wdigital.com"},{"name":"atila.santos","email":"atila.santos@b2wdigital.com"},{"name":"dentxinho","email":"raul_baldner_junior@hotmail.com"},{"name":"vitorhnn","email":"victor.chiletto@b2wdigital.com"},{"name":"nlaranjeira01","email":"nlaranjeira01@gmail.com"}],"author":{"name":"Kibae Shin","email":"nonunnet@gmail.com"},"repository":{"type":"git","url":"git://github.com/kibae/node-lru-native.git"},"license":"MIT","dependencies":{"nan":"^2.14.2"},"devDependencies":{"chai":"^4.2.0","mocha":"^8.2.1","tslint-lt":"^1.8.0","typescript":"^3.4.5"},"scripts":{"test":"npm run build && node --expose-gc --trace-gc node_modules/mocha/bin/_mocha -R spec","valgrind":"npm run build && valgrind --leak-check=full --show-possibly-lost=no node --expose-gc --trace-gc node_modules/mocha/bin/_mocha -R spec","build":"node-gyp rebuild","install":"npm run build","lint":"npm run prettier && tslint --format stylish --project .","prettier":"prettier --config node_modules/tslint-lt/.prettierrc.yml --write \"{,!node_modules/}**/*.{ts,tsx,css,scss,html,js,jsx,yml,json}\"","docker":"docker build ."},"gitHead":"c88032969403ae7f9334edabc655822daec4fde0","bugs":{"url":"https://github.com/kibae/node-lru-native/issues"},"homepage":"https://github.com/kibae/node-lru-native#readme","_id":"@b2wads/lru-native2@1.2.5-hack","_nodeVersion":"12.18.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NAstYUgRGJFKa9r+hWTRRgkVWJjpZFVForFDWnlsP68Z/XwfQLj91aHjsRYs+pwQjfitXqMEy4+/HDZIYQeg5g==","shasum":"e703541efe517bf0a8123ed0cf8ca03e951c3821","tarball":"https://registry.npmjs.org/@b2wads/lru-native2/-/lru-native2-1.2.5-hack.tgz","fileCount":14,"unpackedSize":19950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN9PUCRA9TVsSAnZWagAAq/8P/jDSFZQoqiHkzjCWlTrK\nHKJIyPjbjd34yyjcZSvWmpEtgD2kpdyRUs+Nv/nnbSKo8ZjM6z/xAtQ8aFPK\ntHFRZM/G53fmSPNOwqau/02cSgmpzvsEBCvKRLB5LK5HHViHzLwHZ6UmK/CP\nFtbbu32IdHzxiKcBOkbPTu2DtLdrd6j9iRuvqS9Le8aPvVzXrlL1xDvuuOCV\nszmnqvP3iJ0LbpMBqiXigof1ZuPG0/xsY65n+dzcYGmDI/vIm4TugGRYM60z\nF55/wFQ6Lryul6S6nM6SBl+NdTCqzqOPCq2V68KsOuh8wCqzhN8+Cl/IXIMd\npL7IdVHzjx41drw5parPyISbN9p6nylSyuZXXGW2objJdfW1Bn0KMxTXfhvu\nKpYHviyiX2Ea5QL4htBIksop8P5L1eb9mfD1pQS0QyCWvbGGj49YYIritk85\nNp7XjKuyKI5Ojhhe1QEGVWK7HBeLlrBPa9rLjE0ouvyVl5k/m7FpMWKJT3dF\nkNns62+PfoSNvyDYgzgjehXKWWgRWS37p/ZY658SVzSB70FIJGWYftZ+GpbH\nyi4Kjz9BFxG2nifu2ty279lPOJxVCnTpW4hOtW5KKXmNQR6sz+xcBtkPS5ls\nCVm0ftcD2cUgumx0MHTL4i5C5mvzfS7/oZog5/n2ZVrGqwt2zwlui+FcRzW5\n7FLC\r\n=YC9y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDk4rZ6nbbhn6avthAhEjErZ7tCEVyoBQmSX+0hZfO0vAiA2vggCl/fr24xnRyMhmQdyzJS3tnCAPoIi6buCLcEXUg=="}]},"_npmUser":{"name":"dentxinho","email":"raul_baldner_junior@hotmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lru-native2_1.2.5-hack_1631048659976_0.17780515029094346"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-27T12:38:13.528Z","1.2.4-hack":"2020-11-27T12:38:13.990Z","modified":"2023-05-29T14:24:30.284Z","1.2.5-hack":"2021-09-07T21:04:20.087Z"},"maintainers":[{"email":"jean.michel@americanas.io","name":"mikeofic"},{"email":"raul_baldner_junior@hotmail.com","name":"dentxinho"},{"email":"atila.santos@b2wdigital.com","name":"atila.santos"},{"email":"gabriel.hssantos@b2wdigital.com","name":"gabrielhenriques"},{"email":"carlos.cmelo@b2wdigital.com","name":"carlosmeloads"}],"description":"LRU cache module written in C++","homepage":"https://github.com/kibae/node-lru-native#readme","keywords":["LRU","cache","native","c++"],"repository":{"type":"git","url":"git://github.com/kibae/node-lru-native.git"},"author":{"name":"Kibae Shin","email":"nonunnet@gmail.com"},"bugs":{"url":"https://github.com/kibae/node-lru-native/issues"},"license":"MIT","readme":"lru-native2\n===========\n[![Build Status](https://travis-ci.org/d3m3vilurr/node-lru-native.svg?branch=master)](https://travis-ci.org/d3m3vilurr/node-lru-native)\n\nThis is an implementation of a simple in-memory cache for node.js, supporting LRU (least-recently-used) eviction\nand TTL expirations.\n\nIt was developed as an alternative to the (excellent) [node-lru-cache](https://github.com/isaacs/node-lru-cache)\nlibrary for use with hashes with a very large number of items. V8 normally does a good job of optimizing the\nin-memory representation of objects, but it isn't optimized for an object that holds a huge amount of data.\nWhen you add a very large number of properties (particularly with non-integer keys) to an object, performance\nbegins to suffer.\n\nRather than rely on V8 to figure out what we're trying to do, `node-lru-native` is a light wrapper around\n`std::unordered_map` from C++11. A `std::list` is used to track accesses so we can evict the least-recently-used\nitem when necessary.\n\nBased on the [node-hashtable](https://github.com/isaacbwagner/node-hashtable) library by Issac Wagner.\n\n# Usage\n\nInstall via npm:\n\n```\n$ npm install lru-native2\n```\n\nThen:\n\n```javascript\nvar LRUCache = require('lru-native2');\nvar cache = new LRUCache({ maxElements: 1000 });\ncache.set('some-key', 42);\nvar value = cache.get('some-key');\n```\n\nIf you'd like to tinker, you can build the extension using [node-gyp](https://github.com/TooTallNate/node-gyp):\n\n```\n$ npm install -g node-gyp\n$ node-gyp configure\n$ node-gyp build\n```\n\n# Configuration\n\nTo configure the cache, you can pass a hash to the `LRUCache` constructor with the following options:\n\n```\nvar cache = new LRUCache({\n\n  // The maximum number of items to add to the cache before evicting the least-recently-used item.\n  // Default: 0, meaning there is no maximum.\n  maxElements: 10000,\n\n  // The maximum age (in milliseconds) of an item.\n  // The item will be removed if get() is called and the item is too old.\n  // Default: 0, meaning items will never expire.\n  maxAge: 60000,\n\n  // The initial number of items for which space should be allocated.\n  // The cache will resize dynamically if necessary.\n  size: 1000,\n\n  // The maximum load factor for buckets in the unordered_map.\n  // Typically you won't need to change this.\n  maxLoadFactor: 2.0\n\n});\n```\n\n# API\n\n## set(key, value)\n\nAdds the specified item to the cache with the specified key.\n\n## get(key)\n\nReturns the item with the specified key, or `undefined` if no item exists with that key.\n\n## remove(key)\n\nRemoves the item with the specified key if it exists.\n\n## clear()\n\nRemoves all items from the cache.\n\n## size()\n\nReturns the number of items in the cache.\n\n## stats()\n\nReturns a hash containing internal information about the cache.\n\n## setMaxElements(maxElements)\n\nSet the maximum number of items\n\n## setMaxAge(maxAge)\n\nSet the maximum age (in milliseconds) of an item\n\n\n# Changelog\n\n- 1.0.0 -- Update the timestamp when get a value(like common LRU cache). Added SetMaxAge(), SetMaxElements()\n- *forked*\n- 0.4.0 -- Added support for newer versions of Node via NAN\n- 0.3.0 -- Changed memory allocation strategy, fixed issue where remove() would do a seek through the LRU list, code cleanup\n- 0.2.0 -- Fixed issue where maxAge-based removal would result in a seek through the LRU list\n- 0.1.0 -- Initial release\n","readmeFilename":"README.md"}