string-any
v1.0.5
Published
a small package to convert any object to sting
Downloads
6
Readme
string-any
string-any
is a package to convert any object to a string and not [object Object]
Usage
const { toStr } = require('string-any');
// objects
toStr(
{
name: "name",
id: 32918,
randomThing: {
dwq: "hello"
},
func: () => "hello"
}
);
// => "{
// => name: "name",
// => id: 32918,
// => randomThing: {
// => dwq: "hello"
// => },
// => func: () => "hello"
// => }"
// functions
toStr(() => {}) // => "() => {}"
// numbers
toStr(10) // => "10"
// Strings
toStr("hello") // => '"hello"'
// String Objects
toStr(new String("hello")) // => "hello"
// Arrays
toStr([1,2,3]) // => "[1, 2, 3]"
LICENSE
MIT License
Copyright (c) 2019 AliBasicCoder