listformat

A tiny ponyfill for Intl.ListFormat('en')

Usage no npm install needed!

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

README

ListFormat Ponyfill

This is a simple ponyfill for Intl.ListFormat.

Call it with an Array of strings, and it'll reduce them down to one string in a list format:

import listFormat from 'listFormat'
listFormat(['a', 'b', 'c']) === 'a, b, and c'

If Intl.ListFormat is available on the engine you're running, it'll use that.