tosource.js

A polyfill for Mozilla's Object.toSource() method.

Usage no npm install needed!

<script type="module">
  import tosourceJs from 'https://cdn.skypack.dev/tosource.js';
</script>

README

toSource.js

A polyfill for Mozilla's Object.toSource() method. Returns the equivalent JavaScript source code (not JSON) for a JavaScript Object, Number, Boolean, String, RegExp, Error, Date or Function.

See the Mozilla docs for more information.