Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zcong1993/expire-map
map that support expire
https://github.com/zcong1993/expire-map
Last synced: about 23 hours ago
JSON representation
map that support expire
- Host: GitHub
- URL: https://github.com/zcong1993/expire-map
- Owner: zcong1993
- License: mit
- Created: 2018-07-13T06:40:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-12T02:58:39.000Z (over 4 years ago)
- Last Synced: 2024-10-11T13:37:17.247Z (28 days ago)
- Language: TypeScript
- Size: 95.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# expire-map
[![NPM version](https://img.shields.io/npm/v/@zcong/expire-map.svg?style=flat)](https://npmjs.com/package/@zcong/expire-map) [![NPM downloads](https://img.shields.io/npm/dm/@zcong/expire-map.svg?style=flat)](https://npmjs.com/package/@zcong/expire-map) [![CircleCI](https://circleci.com/gh/zcong1993/expire-map/tree/master.svg?style=shield)](https://circleci.com/gh/zcong1993/expire-map/tree/master) [![codecov](https://codecov.io/gh/zcong1993/expire-map/branch/master/graph/badge.svg)](https://codecov.io/gh/zcong1993/expire-map)
[![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/zcong1993/donate)## Install
```bash
$ yarn add @zcong/expire-map
```## Usage
```js
const ExpireMap = require('@zcong/expire-map').defaultconst em = new ExpireMap(5000)
em.setExpire('haha', 'hehe', 2000)
console.log(em.get('haha'))
// 'hehe'
// after 2000 ms
console.log(em.get('haha'))
// undefined
```## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## Author
**expire-map** © [zcong1993](https://github.com/zcong1993), Released under the [MIT](./LICENSE) License.
Authored and maintained by zcong1993 with help from contributors ([list](https://github.com/zcong1993/expire-map/contributors)).> [github.com/zcong1993](https://github.com/zcong1993) · GitHub [@zcong1993](https://github.com/zcong1993)