Skip to content

v2.0.0

Compare
Choose a tag to compare
@motss motss released this 17 Mar 03:44

Improved file structure for both the web and Node.js

Notable changes

Leverage file extension that favors each different module system and environment.

  1. Use .mjs for ES Modules on Node.js
import { normalize } from 'normalize-diacritics'; /** Use `index.mjs` */
  1. Use .js for CommonJS on Node.js
const { normalize } = require('normalize-diacritics'); /** Use `index.js` */
  1. 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>
  1. 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>