Add "exports" to package.json to indicate to modern Node.js and TypeScript versions how to import the package.
Add "slugify.mjs" as the ES module.
The "slugify.mjs" file is a thin wrapper around the original code, to avoid re-implementing the logic.
The new code is not tested, I'm not sure how to set up mocha to test both .js and .mjs at the same time. Since the implementation is the same, the tests would only cover that the file is valid ESM and can be correctly imported. I'm not sure how much value that adds.
Feel free to squash the commits in this PR, I didn't pay particular attention to clean commits.
The "slugify.mjs" file is a thin wrapper around the original code, to avoid re-implementing the logic.
The new code is not tested, I'm not sure how to set up mocha to test both .js and .mjs at the same time. Since the implementation is the same, the tests would only cover that the file is valid ESM and can be correctly imported. I'm not sure how much value that adds.
Feel free to squash the commits in this PR, I didn't pay particular attention to clean commits.