$ npm install image-convert-ascii
new Convert(img element ID, pre element ID, width, height);
<body style="font-size: 10px">
<pre id="pre"></pre>
<!-- Insert the image want to convert -->
<img id="img" src="./asciiTest.png" crossorigin="anonymous" />
</body>
import Convert from 'image-convert-ascii';
//input img, pre element ID and size
new Convert('img', 'pre', 100, 100);
<script defer type="module">
import Convert from 'https://cdn.jsdelivr.net/gh/hoonsbory/image-convert-ascii/Convert.js';
new Convert('img', 'pre', 100, 100);
</script>