# modern-map

> modern-map is can limit size and save anything

Latest version **1.0.1** (published 2018-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install modern-map
pnpm add modern-map
yarn add modern-map
bun add modern-map
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-11-20 |
| First published | 2018-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jungwoo An |
| Maintainers | o1o9814 |
| Keywords | map, limit, size, limit-map |

## Links

- npm: https://www.npmjs.com/package/modern-map
- Repository: https://github.com/Jungwoo-An/modern-map
- Homepage: https://github.com/Jungwoo-An/modern-map#readme
- Issues: https://github.com/Jungwoo-An/modern-map/issues
- npm.io page: https://npm.io/package/modern-map

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-11-20
- 1.0.0 — 2018-11-19

## README

# Modern Map

This is simply, easily, able to limit, similar to pure object

## Getting started

```bash
# Install via npm
npm install modern-map

# Install via yarn (Recommend)
yarn add modern-map
```

## API Document

`Map.create<T>(limitSize?: number): Partial<T>`

Initialize function.

Parameters:

- limitSize (optional): Set limit size of modern-map. If not set, will be infinite size.

```js
import Map from 'modern-map'

const obj = Map.create()

// getter and setter is same as pure object

// set value
obj.key = value
// or
obj[key] = value

// get value
obj.key
// or
obj[key]
```

If you using typescript and want to set type of map.

```ts
import Map from 'modern-map'

interface Data {
  item1: number
  item2: boolean
}

const obj = Map.create<Data>() // return type is Partial<Data>

obj.item1 = 0
```

`Map.length [number]`

Return size of map

```js
obj.length
```

`How to use loop?`

same as pure object

```js
import Map from 'modern-map'

const obj = Map.create()

obj['example'] = 1

Object.keys(obj) // ['example']
```

## Compatibility

[all browsers that support Proxy](https://caniuse.com/#search=proxy)

## Author

[Jungwoo-An](https://github.com/Jungwoo-An)

## License

MIT

---
_Source: https://npm.io/package/modern-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
