1.0.1 • Published 11 months ago

ts-anything-to-string v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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"}'
1.0.1

11 months ago

1.0.0

11 months ago