Skip to content

A simple and useful function to transform anything in a full readable string

License

Notifications You must be signed in to change notification settings

jodaltro/ts-anything-to-string

Repository files navigation

Typescript Anything to String

npm version

A simple and useful function to transform anything in a full readable string.

Installation

npm install ts-anything-to-string --save

How to use

import { safeToString } from 'ts-anything-to-string';

const error = new Error('error');
console.log(safeToString(error)); //'Error: error'

const object = { id: 'test' };
console.log(safeToString(object)); //'{"id":"teste"}'

About

A simple and useful function to transform anything in a full readable string

Resources

License

Stars

Watchers

Forks

Packages

No packages published