Skip to content

Commit

Permalink
Require Node.js 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 13, 2020
1 parent e5b868b commit 0cf3d6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
}
}
8 changes: 2 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -30,7 +28,6 @@ lru.get('🦄');
//=> '🌈'
```


## API

### new QuickLRU(options?)
Expand All @@ -43,7 +40,7 @@ Type: `object`

#### maxSize

*Required*<br>
*Required*\
Type: `number`

The maximum number of items before evicting the least recently used items.
Expand Down Expand Up @@ -92,7 +89,6 @@ Iterable for all the values.

The stored item count.


---

<div align="center">
Expand Down

0 comments on commit 0cf3d6b

Please sign in to comment.