Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abranhe/s-to-o
String to Object (self explanatory)
https://github.com/abranhe/s-to-o
object string string-to-object
Last synced: 8 days ago
JSON representation
String to Object (self explanatory)
- Host: GitHub
- URL: https://github.com/abranhe/s-to-o
- Owner: abranhe
- License: mit
- Created: 2018-08-17T20:27:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-26T05:07:30.000Z (over 5 years ago)
- Last Synced: 2024-11-09T16:02:46.210Z (11 days ago)
- Topics: object, string, string-to-object
- Language: JavaScript
- Homepage: https://npm.im/s-to-o
- Size: 10.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
Awesome Lists containing this project
README
# s-to-o
> Convert an string into an object
[![](https://img.shields.io/travis/abranhe/s-to-o.svg?logo=travis)](https://travis-ci.org/abranhe/s-to-o)
[![](https://abranhe.com/badge.svg)](https://github.com/abranhe)
[![](https://cdn.abranhe.com/badges/cash-me.svg)](https://cash.me/$abranhe)
[![](https://cdn.abranhe.com/badges/patreon.svg)](https://patreon.com/abranhe)
[![](https://img.shields.io/github/license/abranhe/s-to-o.svg)](https://github.com/abranhe/s-to-o/blob/master/license)
[![](https://img.shields.io/npm/v/s-to-o.svg)](https://npmjs.com/package/s-to-o)## Install
```
npm install s-to-o
```## Usage
```js
const sto = require('s-to-o');console.log(sto('a: 1, b: 2, c: 3, d: 4'));
// => { a: '1', b: '2', c: '3', d: '4' }
```## API
### sto(input)
Type: `function`
Return Type: `object`
A replacement for JSON.parse() which converts an string into an object.
#### input
Type: `string`
String to be parsed.
## Related
- [str-to-arr](https://github.com/abranhe/str-to-arr): Add words from a string to an array
## License
MIT © [Abraham Hernandez](https://abranhe.com)