Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnhof/parse-types
Parse types of nested javascript strings
https://github.com/johnhof/parse-types
Last synced: 20 days ago
JSON representation
Parse types of nested javascript strings
- Host: GitHub
- URL: https://github.com/johnhof/parse-types
- Owner: johnhof
- License: mit
- Created: 2016-07-13T16:40:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-14T22:24:10.000Z (over 8 years ago)
- Last Synced: 2024-10-12T10:48:21.447Z (about 1 month ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parse-type
[![Build Status](https://travis-ci.org/johnhof/parse-types.svg?branch=master)](https://travis-ci.org/johnhof/parse-types)
Parse types of nested javascript strings
# Usage
```
let parse = require('parse-types');let result;
// String
result = parse("{"test":"1","another":"false","nope":"tru","float":"0.1","nested":{"property":{"number":"10"}},"array":["of","0",{"various":"10","values":"sad"}]}");// OR
// Object
result = parse({
test: '1',
another: 'false',
nope: 'tru',
float: '0.1',
nested: {
property: {
number: '10'
}
},
array: [
'of',
'0',
{
various: '10',
values: 'sad'
}
]
});console.log(result);
/*{
"test": 1,
"another": false,
"nope": "tru",
"float": 0.1,
"nested": {
"property": {
"number": 10
}
},
"array": [
"of",
0,
{
"various": 10,
"values": "sad"
}
]
}*/
```
# Authors
- [John Hofrichter](https://github.com/johnhof)