https://github.com/flipeador/js-dictionary
Javascript Map with temporary elements and additional utility methods.
https://github.com/flipeador/js-dictionary
browser collection dictionary javascript map nodejs temporary
Last synced: about 1 month ago
JSON representation
Javascript Map with temporary elements and additional utility methods.
- Host: GitHub
- URL: https://github.com/flipeador/js-dictionary
- Owner: flipeador
- License: apache-2.0
- Created: 2023-02-08T14:32:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-15T15:41:08.000Z (almost 3 years ago)
- Last Synced: 2025-06-27T07:46:51.635Z (about 1 year ago)
- Topics: browser, collection, dictionary, javascript, map, nodejs, temporary
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JavaScript Dictionary
JavaScript Map with temporary elements and additional utility methods.
## Installation
```
npm i flipeador/js-dictionary#semver:^1.0.0
```
## Example
```js
import { Dict } from '@flipeador/js-dictionary';
const map = new Dict();
map.set('key', 'never expires');
map.set('key', 'expires in 1 second', 1000); // set timer
map.set('key', 'expires in less than a second', null); // keep current timer
map.set('key', 'expires in 1 second'); // refresh timer
map.get('key', false); // keep current timer
map.get('key'); // refresh timer
map.set('key', 'never expires', 0); // remove timer
console.log(map); // Dict(1) [Map] { 'key' => 'never expires' }
```
## License
This project is licensed under the **Apache License 2.0**. See the [license file](LICENSE) for details.