From 0cf3d6b7928b2b951bf614fb5cecbfc97d3cdd70 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 13 Feb 2020 20:08:06 +0700 Subject: [PATCH] Require Node.js 10 --- .travis.yml | 1 - package.json | 13 +++++++------ readme.md | 8 ++------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1492647..fd301d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,5 @@ language: node_js node_js: - '12' - '10' - - '8' after_success: - './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls' diff --git a/package.json b/package.json index 4854b32..9344fa1 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,17 @@ { "name": "quick-lru", "version": "4.0.1", - "description": "Simple \"Least Recently Used\" (LRU) cache", + "description": "Simple “Least Recently Used” (LRU) cache", "license": "MIT", "repository": "sindresorhus/quick-lru", + "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, "engines": { - "node": ">=8" + "node": ">=10" }, "scripts": { "test": "xo && nyc ava && tsd" @@ -35,8 +36,8 @@ "devDependencies": { "ava": "^2.0.0", "coveralls": "^3.0.3", - "nyc": "^14.1.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" + "nyc": "^15.0.0", + "tsd": "^0.11.0", + "xo": "^0.26.0" } } diff --git a/readme.md b/readme.md index ef95bf5..f7b841e 100644 --- a/readme.md +++ b/readme.md @@ -1,19 +1,17 @@ # quick-lru [![Build Status](https://travis-ci.org/sindresorhus/quick-lru.svg?branch=master)](https://travis-ci.org/sindresorhus/quick-lru) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/quick-lru/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/quick-lru?branch=master) -> Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29) +> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29) Useful when you need to cache something and limit memory usage. Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`. - ## Install ``` $ npm install quick-lru ``` - ## Usage ```js @@ -30,7 +28,6 @@ lru.get('🦄'); //=> '🌈' ``` - ## API ### new QuickLRU(options?) @@ -43,7 +40,7 @@ Type: `object` #### maxSize -*Required*
+*Required*\ Type: `number` The maximum number of items before evicting the least recently used items. @@ -92,7 +89,6 @@ Iterable for all the values. The stored item count. - ---