# to-path

> Converts string to a property path array.

Latest version **1.0.1** (published 2016-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-path
pnpm add to-path
yarn add to-path
bun add to-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.0.1 |
| Published | 2016-04-15 |
| First published | 2016-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | bubkoo |
| Maintainers | bubkoo |
| Keywords | to, parse, convert, converter, parser, path, paths, string, object |

## Links

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

## Dependencies (4)

- [is-nil](https://npm.io/package/is-nil.md) ^1.0.0
- [to-str](https://npm.io/package/to-str.md) ^1.0.0
- [is-symbol](https://npm.io/package/is-symbol.md) ^1.0.1
- [is-array-like](https://npm.io/package/is-array-like.md) ^1.0.3

## 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.1 (latest) — 2016-04-15
- 1.0.0 — 2016-04-13
- 0.0.0 — 2016-04-12

## README

# to-path

> Converts string to a property path array.



[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/gearcase/to-path/blob/master/LICENSE)

[![build:?](https://img.shields.io/travis/gearcase/to-path/master.svg?style=flat-square)](https://travis-ci.org/gearcase/to-path)
[![coverage:?](https://img.shields.io/coveralls/gearcase/to-path/master.svg?style=flat-square)](https://coveralls.io/github/gearcase/to-path)


## Install

```
$ npm install --save to-path 
```

## Usage

> For more use-cases see the [tests](https://github.com/gearcase/to-path/blob/master/test/spec/index.js)

```js
var toPath = require('to-path');

toPath('a');          // => ['a']
toPath('a.b.c');      // => ['a', 'b', 'c']
toPath('a[0].b.c');   // => ['a', '0', 'b', 'c']
toPath('a[x].b.c');   // => ['a', 'x', 'b', 'c']
toPath('a["x"].b.c'); // => ['a', 'x', 'b', 'c']
toPath(0);            // => ['0']
toPath([1, 2, 3]);    // => ['1', '2', '3']
```

## Related

- [object-at](https://github.com/gearcase/object-at) - Get object's property according to the path.
- [object-has](https://github.com/gearcase/object-has) - Checks if path is a direct property of object.
- [object-set](https://github.com/gearcase/object-set) - Sets the value at path of object.
- [object-unset](https://github.com/gearcase/object-unset) - Removes the property at path of object.


## Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please [create an issue](https://github.com/gearcase/to-path/issues/new).

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