https://github.com/canjs/can-string-to-any
Convert strings to equivalent JavaScript values
https://github.com/canjs/can-string-to-any
Last synced: about 1 year ago
JSON representation
Convert strings to equivalent JavaScript values
- Host: GitHub
- URL: https://github.com/canjs/can-string-to-any
- Owner: canjs
- License: mit
- Created: 2018-04-14T20:31:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-14T04:43:47.000Z (about 6 years ago)
- Last Synced: 2025-06-11T06:48:28.978Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://canjs.com/doc/can-string-to-any.html
- Size: 26.4 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# can-string-to-any
[](https://www.bitovi.com/community/slack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://forums.bitovi.com/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://github.com/canjs/can-string-to-any/blob/master/LICENSE)
[](https://www.npmjs.com/package/can-string-to-any)
[](https://travis-ci.org/canjs/can-string-to-any)
[](https://greenkeeper.io/)
Convert strings to equivalent JavaScript values. Works in NodeJS and in all browsers.
## Use
```js
import stringToAny from 'can-string-to-any';
stringToAny("null") //-> null
stringToAny("-3") //-> -3
stringToAny("false") //-> false
stringToAny("NaN") //-> NaN
```
### Standalone use
Load the `global` version of the plugin:
```html
```
## Documentation
Read the [can-string-to-any API docs on CanJS.com](https://canjs.com/doc/can-string-to-any.html).
## Changelog
See the [latest releases on GitHub](https://github.com/canjs/can-string-to-any/releases).
## Contributing
The [contribution guide](https://github.com/canjs/can-string-to-any/blob/master/CONTRIBUTING.md) has information on getting help, reporting bugs, developing locally, and more.
## License
[MIT](https://github.com/canjs/can-string-to-any/blob/master/LICENSE)