Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
merge pull request #1 from azurystudios/dev
Browse files Browse the repository at this point in the history
merge code for v2
  • Loading branch information
boywithkeyboard committed Oct 31, 2021
2 parents af9dcbc + 4f0e02e commit 32cb6f2
Show file tree
Hide file tree
Showing 12 changed files with 8,024 additions and 279 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
open-pull-requests-limit: 10
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dev.js
node_modules
build
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
dev.js
dev
src
.github
changelog.md
21 changes: 21 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# cachu's changelog

Available Releases:

- [v2.0.0](#2.0.0)

## 2.0.0

### Changes

- renamed functions
- added global instance
- added `purgeMany`, `getMany`, `purgeManyByCondition`, `getManyByCondition`, `getKeysOfItems`, `getValuesOfItems`, `getAmountOfItems`, and `each` functions
- added engine requirements
- added funding
- minified package
- made testing easier

### Bug Fixes

- fixed deletion of expired items
25 changes: 25 additions & 0 deletions dev/instance.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Cachu } from '../src/instance.mjs'

const cachu = new Cachu({
maxAge: 300
})

async function dev() {
await cachu.set(1, 'other')

setTimeout(async () => {
await cachu.set(2, 'item')
}, 250)

setTimeout(async () => {
await cachu.set(3, 'item')
}, 500)

setTimeout(async () => {
console.log(await cachu.purgeManyByCondition(item => {
return item[1] === 'other'
}))
console.log(cachu.store)
}, 1000)
}
dev()
Loading

0 comments on commit 32cb6f2

Please sign in to comment.