# simple-object-path

> Simple object navigation

Latest version **1.1.0** (published 2016-07-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install simple-object-path
pnpm add simple-object-path
yarn add simple-object-path
bun add simple-object-path
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-07-25 |
| First published | 2016-03-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | JDS |
| Maintainers | joshsteverson |

## Links

- npm: https://www.npmjs.com/package/simple-object-path
- Repository: https://github.com/Joshsteverson/object-path
- Homepage: https://github.com/Joshsteverson/object-path#readme
- Issues: https://github.com/Joshsteverson/object-path/issues
- npm.io page: https://npm.io/package/simple-object-path

## Recent versions

- 1.1.0 (latest) — 2016-07-25
- 1.0.2 — 2016-03-10
- 1.0.1 — 2016-03-10
- 1.0.0 — 2016-03-10

## README

# Simple ObjectPath

### JavaScript object navigation.

Simple ObjectPath is a module that allows you to navigate to a given location within a Javascript object. Allows simpler access to deeply nested properties. Allows validation of existence of those same deeply nested properties.


# Installation
```sh
$ npm install simple-object-path
```
# Usage
```javascript
var objectPath = require('simple-object-path');

var obj = {animal:
    {
        type: 'Feline',
        dailyNeeds: [
            {timeOfDay: 'morning', need: 'Breakfast'},
            {timeOfDay: 'evening', need: 'Dinner'}
        ]
    }
};
var result = objectPath(obj, 'animal/dailyNeeds/1/timeOfDay');
console.log(result); // 'evening'

var objWithArray = {
    prop: {
        array: [
            [
                ['0,0,0', '0,0,1'],
                ['0,1,0', '0,1,1']
            ],
            [
                ['1,0,0', '0,0,1'],
                ['1,1,0', '1,1,1']
            ]
        ]
    }
};
var resultNestedArray1 = objectPath(objWithArray, 'prop/array/0/1/1');
console.log(resultNestedArray1); // '0,1,1'
var resultNestedArray2 = objectPath(objWithArray, 'prop/array/4/0/4');
console.log(resultNestedArray2); // null
```

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