Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kartikesingh/read-nested-object
Read a nested property of an object
https://github.com/kartikesingh/read-nested-object
Last synced: 24 days ago
JSON representation
Read a nested property of an object
- Host: GitHub
- URL: https://github.com/kartikesingh/read-nested-object
- Owner: KartikeSingh
- License: mit
- Created: 2021-11-28T07:06:07.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-22T12:45:52.000Z (about 2 years ago)
- Last Synced: 2023-03-05T23:08:07.761Z (almost 2 years ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/read-nested-object
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Installations
```
npm i read-nested-object
```# What ?
With this module you can read nested object with keys like "name.first", "hobby.real.0" etc# How ?
```js
const readObject = require('read-nested-object');// import readObject from "./" // for typescript
const ob = {
name: {
first: "Shisui",
last: "Uchiha",
},
hobby: {
real: ["sleeping", "wasting time"],
fake: ["coding", "gaming"]
}
}console.log(readObject(ob,"name.first")); // output => Shisui
console.log(readObject(ob,"hobby.real.0")); // output => sleeping
```# Supports
For support or issues or queries contace me on my [discord server](https://discord.gg/XYnMTQNTFh), If you find any bug create a issue [here](https://github.com/KartikeSingh/read-nested-object/issues).