is-ascii

Test if a string is 100% ascii

Usage no npm install needed!

<script type="module">
  import isAscii from 'https://cdn.skypack.dev/is-ascii';
</script>

README

isAscii


Test if a string is 100% ascii.

npm version Build Status License: MIT


Why

I needed to see if a string was 100% ascii.


Usage

import isAscii from 'is-ascii';

isAscii('foo bar baz !?!!!!???? @#$%^&*(){}[]\|-_+=`~'); // true
isAscii('💩💩💩‽‽‽'); // false

License

MIT: http://ariporad.mit-license.org.