v2.0.0
Improved file structure for both the web and Node.js
Notable changes
Leverage file extension that favors each different module system and environment.
- Use
.mjs
for ES Modules on Node.js
import { normalize } from 'normalize-diacritics'; /** Use `index.mjs` */
- Use
.js
for CommonJS on Node.js
const { normalize } = require('normalize-diacritics'); /** Use `index.js` */
- Default
.js
for ES Modules on the web
<script type="module">
import { normalize } from 'https://unpkg.com/normalize-diacritics@latest/dist/normalize-diacritics.js';
</script>
- Use
.iife.js
for IIFE on the web
<script src="https://unpkg.com/normalize-diacritics@latest/dist/normalize-diacritics.iife.js"></script>
<script>
const { normalize } = window.NormalizeDiacritics;
</script>