Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabioricali/stringme
This is a wrapper of JSON stringify that converts also undefined and null to string.
https://github.com/fabioricali/stringme
json-stringify stringify
Last synced: 10 days ago
JSON representation
This is a wrapper of JSON stringify that converts also undefined and null to string.
- Host: GitHub
- URL: https://github.com/fabioricali/stringme
- Owner: fabioricali
- License: mit
- Created: 2018-03-11T11:27:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-16T10:20:24.000Z (over 6 years ago)
- Last Synced: 2024-10-12T19:06:28.309Z (24 days ago)
- Topics: json-stringify, stringify
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Stringme
This is a wrapper of JSON stringify that converts also undefined and null to string.
## Installation
```
npm install --save stringme
```## Usage
```javascriptconst stringme = require('stringme');
stringme(undefined); // "undefined"
stringme(null); // "null"
stringme({a:1}); // {"a":1}
stringme(new Date()); // "2018-03-11T12:48:46.252Z"// Remove quotes
stringme(null, {quotes: false}); // null// JSON stringify params see https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
stringme({an:'object'}, {replace: null, space: 2});
```## Changelog
You can view the changelog here## License
Stringme is open-sourced software licensed under the MIT license## Author
Fabio Ricali