1.0.5 • Published 5 years ago

string-any v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

string-any

Codacy Badge npm GitHub npm bundle size

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

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago