Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/igorskyflyer/npm-jmap

๐Ÿ•ถ๏ธ Reads a JSON file into a Map. ๐ŸŒป
https://github.com/igorskyflyer/npm-jmap

back-end es6 file file-system igorskyflyer javascript js json map npm read typescript utility

Last synced: 1 day ago
JSON representation

๐Ÿ•ถ๏ธ Reads a JSON file into a Map. ๐ŸŒป

Awesome Lists containing this project

README

        

# jMap
๐Ÿ•ถ๏ธ Reads a JSON file into a Map. ๐ŸŒป






๐Ÿ’– Support further development


I work hard for every project, including this one and your support means a lot to me!


Consider buying me a coffee. โ˜•


Thank you for supporting my efforts! ๐Ÿ™๐Ÿ˜Š





Donate to igorskyflyer




@igorskyflyer






## ๐Ÿ•ต๐Ÿผ Usage

Install it by executing:

```shell
npm i "@igor.dvlpr/jmap"
```


## ๐Ÿคน๐Ÿผ API

```jMap(path: string): Map```

Reads a JSON file into a Map.


```path: string``` - path to the JSON file, **required**.


***Throws*** an exception if the file cannot be read or there is an error while parsing the JSON file.

Returns `Map` with all JSON properties and values.


`demo.ts`

```ts
import { jMap } from '@igor.dvlpr/jmap'

const sample: Map = jMap('./test/data/sample.json')

console.log(sample.get('glossary').title) // 'example glossary'

```

> The used sample JSON file is located here, [JSON sample](https://github.com/igorskyflyer/npm-jmap/blob/main/test/data/sample.json).

---

## ๐Ÿชช License

Licensed under the MIT license which is available here, [MIT license](https://github.com/igorskyflyer/npm-jmap/blob/main/LICENSE).

---

## ๐Ÿงฌ Related

[@igor.dvlpr/zep](https://www.npmjs.com/package/@igor.dvlpr/zep)

> _๐Ÿง  Zep is a zero-dependency, efficient debounce module. โฐ_

[@igor.dvlpr/pathexists](https://www.npmjs.com/package/@igor.dvlpr/pathexists)

> _๐Ÿงฒ Provides ways of properly checking if a path exists inside a given array of files/directories both on Windows and UNIX-like operating systems. ๐Ÿ—บ_

[@igor.dvlpr/adblock-filter-counter](https://www.npmjs.com/package/@igor.dvlpr/adblock-filter-counter)

> _๐Ÿฒ A dead simple npm module that counts Adblock filter rules.๐Ÿฆ˜_

[@igor.dvlpr/mp3size](https://www.npmjs.com/package/@igor.dvlpr/mp3size)

> _๐Ÿงฎ Calculates an estimated file size of Mp3 files. ๐ŸŽถ_

[@igor.dvlpr/odin](https://www.npmjs.com/package/@igor.dvlpr/odin)

> _๐Ÿ”ฑ Odin is an Object wrapper that allows you to create objects and set their attributes - all at once! ๐Ÿ”บ_




>
> Provided by **Igor Dimitrijeviฤ‡** ([*@igorskyflyer*](https://github.com/igorskyflyer/)).
>