# pathino

> Get and put element E at path P in object O.

Latest version **1.0.10** (published 2020-04-08) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install pathino
pnpm add pathino
yarn add pathino
bun add pathino
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2020-04-08 |
| First published | 2020-03-08 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Anwar Hahj Jefferson-George |
| Maintainers | anwarhahjjeffersongeorge |
| Keywords | pathino |

## Links

- npm: https://www.npmjs.com/package/pathino
- Repository: https://github.com/anwarhahjjeffersongeorge/pathino
- Homepage: https://github.com/anwarhahjjeffersongeorge/pathino#readme
- Issues: https://github.com/anwarhahjjeffersongeorge/pathino/issues
- npm.io page: https://npm.io/package/pathino

## Dependencies (1)

- [esm](https://npm.io/package/esm.md) ^3.2.25

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.10 (latest) — 2020-04-08
- 1.0.9 — 2020-04-03
- 1.0.8 — 2020-03-09
- 1.0.7 — 2020-03-09
- 1.0.6 — 2020-03-08

## README

[![Version](https://img.shields.io/github/package-json/v/anwarhahjjeffersongeorge/pathino/master.svg)](https://github.com/anwarhahjjeffersongeorge/pathino)[![Build Status](https://travis-ci.org/anwarhahjjeffersongeorge/pathino.svg?branch=master)](https://travis-ci.org/anwarhahjjeffersongeorge/pathino) [![codecov](https://codecov.io/gh/anwarhahjjeffersongeorge/pathino/branch/master/graph/badge.svg)](https://codecov.io/gh/anwarhahjjeffersongeorge/pathino)
------------

[![license](https://img.shields.io/github/license/anwarhahjjeffersongeorge/pathino.svg)](UNLICENSE) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-XO-33a3d3.svg)](https://github.com/xojs/xo)

--------------

# &mdash; `pathino` &mdash;
### [Documentation](https://anwarhahjjeffersongeorge.github.io/pathino/)

### Get and put element E at path P in object O.

A bunch of other libraries do this already. [Search "dot notation" on `npm`](https://www.npmjs.com/search?q=dot%20notation) to find some of them.

This package is for when the objects contain symbol keys.

------
## Installation

Run `npm install pathino`

## Usage
This package exports five functions:

### `dotParse`
Parse a dot notated path, remove whitespace-only path elements  

Argument     | Type                     | Required | Description
------------ | ------------------------ | -------- | -----------
`path`       | `String`                 | No*     |  The dot path to parse

* `dotParse` won't throw without `path`, but it won't return anything useful either.

### `getPathInO` 

Deep find element in an object by path elements p, returning undefined if the path or element at the path was undefined. 

Argument     | Type                     | Required | Description
------------ | ------------------------ | -------- | -----------
`original`   | `Object`                 | No       |  The object
`...paths`   | `Arguments`              | Yes      | The path strings/symbols 

### `dotGetPathInO`  
Deep find something in an object using dot-notation formatted path string  

Argument        | Type              | Required | Description
--------------- | ----------------- | -------- | -----------
`original`      | `Object`          | No       |  The object
`pathstring`    | `String`          | Yes      |  The dot-notated path string


### `putPathInO`
Deep put something in an object by path elements p, creating tree as needed, using Object.assign  

Argument     | Type              | Required | Description
------------ | ----------------- | -------- | -----------
`original`   | `Object`          | No       |  The object
`value`      | `Any`             | Yes      |  The new element
`...paths`   | `Arguments`       | Yes      | The path strings/symbols 

### `dotPutPathInO`
Deep put something in an object using dot-notation formatted path string and Object.assign  

Argument     | Type           | Required | Description
------------ | ---------------| -------- | -----------
`original`   | `Object`       | No       |  The object
`value`      | `Any`          | Yes      |  The new element
`pathstring` | `String`       | Yes      | The dot-notated path strings

## Testing
npm test

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