stringme

1.1.1 • Public • Published

Stringme

This is a wrapper of JSON stringify that converts also undefined and null to string.





Installation

npm install --save stringme

Usage

 
const 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

Package Sidebar

Install

npm i stringme

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

32.5 kB

Total Files

15

Last publish

Collaborators

  • fabioricali