Skip to content

Commit

Permalink
fix: improve browser compatibility (#44)
Browse files Browse the repository at this point in the history
* fix: improve browser compatibility

* docs: improve description
  • Loading branch information
wellwelwel authored Sep 20, 2024
1 parent e087a57 commit a952976
Show file tree
Hide file tree
Showing 5 changed files with 2,663 additions and 101 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![GitHub Workflow Status (Bun)](https://img.shields.io/github/actions/workflow/status/wellwelwel/lru.min/ci_bun.yml?event=push&label=&branch=main&logo=bun&logoColor=ffffff&color=f368e0)](https://github.com/wellwelwel/lru.min/actions/workflows/ci_bun.yml?query=branch%3Amain)
[![GitHub Workflow Status (Deno)](https://img.shields.io/github/actions/workflow/status/wellwelwel/lru.min/ci_deno.yml?event=push&label=&branch=main&logo=deno&logoColor=ffffff&color=079992)](https://github.com/wellwelwel/lru.min/actions/workflows/ci_deno.yml?query=branch%3Amain)

🔥 An extremely fast and efficient <strong><a href="https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29">LRU</a> Cache</strong> for <strong>JavaScript</strong> (<strong>Browser</strong> compatible) — **6.7KB**.
🔥 An extremely fast and efficient <strong><a href="https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29">LRU</a> Cache</strong> for <strong>JavaScript</strong> (<strong>Browser</strong> compatible) — **6.8KB**.

</div>

Expand Down Expand Up @@ -103,10 +103,14 @@ const { createLRU } = require('lru.min');

#### Browser

> Requires **ES6**.
```html
<script src="https://cdn.jsdelivr.net/npm/lru.min/browser/lru.min.js"></script>
```

- You can use tools such as [**Babel**](https://github.com/babel/babel) to increase the compatibility rate.

### Create a new LRU Cache

> Set maximum size when creating **LRU**.
Expand Down
13 changes: 7 additions & 6 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
"files": {
"include": ["**/**"],
"ignore": [
Expand All @@ -23,13 +23,13 @@
},
"correctness": {
"all": true,
"noNodejsModules": "off"
"noNodejsModules": "off",
"useImportExtensions": "error"
},
"nursery": {
"all": true,
"useImportRestrictions": "off",
"useImportExtensions": "error",
"noConsole": "off"
"noSecrets": "off"
},
"performance": {
"all": true,
Expand All @@ -44,7 +44,8 @@
"suspicious": {
"all": true,
"noConsoleLog": "off",
"noEmptyBlockStatements": "off"
"noEmptyBlockStatements": "off",
"noConsole": "off"
},
"style": {
"all": true,
Expand All @@ -64,7 +65,7 @@
"correctness": {
"noNodejsModules": "off"
},
"nursery": {
"performance": {
"useTopLevelRegex": "off"
}
}
Expand Down
Loading

0 comments on commit a952976

Please sign in to comment.