Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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. ๐ป
- Host: GitHub
- URL: https://github.com/igorskyflyer/npm-jmap
- Owner: igorskyflyer
- License: mit
- Created: 2024-06-25T20:38:21.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-06-25T21:53:20.000Z (4 months ago)
- Last Synced: 2024-09-27T14:45:43.825Z (about 1 month ago)
- Topics: back-end, es6, file, file-system, igorskyflyer, javascript, js, json, map, npm, read, typescript, utility
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@igor.dvlpr/jmap
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
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! ๐๐
@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/)).
>