mathiasbynens / emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.
https://mths.be/emoji-regex
MIT License
1.72k stars 175 forks source link

Add ECMAScript module support #99

Closed nstringham closed 1 year ago

nstringham commented 2 years ago

This PR solves the same problem as #37 but in a different way

this PR also fixes #89

this PR allows users to do

import emojiRegex from 'emoji-regex';

or

const { default: emojiRegex } = await import('emoji-regex');

or

const emojiRegex = require('emoji-regex');

it does this by adding index.mjs which is like index.js except that is an es module instead of a commonjs module

mathiasbynens commented 1 year ago

Thanks!