Skip to content

v0.15.0 - CDN Optimization

Choose a tag to compare

@Zheruel Zheruel released this 21 Sep 12:35
· 36 commits to main since this release
0b83567

🚀 CDN Optimization Release

This release adds full support for using nano-string-utils directly from CDN services, making it easier than ever to use in browser environments without any build tools.

✨ What's New

CDN Support

  • IIFE Build Format - New browser-ready build that exposes nanoStringUtils global variable
  • CDN Configuration - Added unpkg, jsdelivr, and browser fields to package.json
  • Zero Build Tools Required - Use directly via <script> tags in HTML

📦 Usage

Via Script Tag

<script src="https://unpkg.com/nano-string-utils@0.15.0/dist/index.iife.js"></script>
<script>
  const slug = nanoStringUtils.slugify("Hello World!");
  console.log(slug); // 'hello-world'
</script>

Via ES Modules

<script type="module">
  import { slugify, camelCase } from 'https://unpkg.com/nano-string-utils@0.15.0/dist/index.js';
  
  console.log(slugify("Hello World")); // 'hello-world'
  console.log(camelCase("hello-world")); // 'helloWorld'
</script>

🏗️ Build Improvements

  • Triple output format: ESM, CommonJS, and IIFE
  • All builds are minified and tree-shaken
  • Source maps included for all formats
  • Bundle size remains under 6.5KB

📊 Stats

  • ESM: 6.01 KB (brotli compressed)
  • CJS: 6.41 KB (brotli compressed)
  • IIFE: ~19 KB (minified)
  • Functions: 41 utilities
  • Dependencies: Still zero! 🎉

🔗 CDN Links

📝 Full Changelog

See CHANGELOG.md for details.