@fr0st/datetime 8.0.2 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # FrostDateTime
2
2
 
3
3
  [![CI](https://github.com/elusivecodes/FrostDateTime/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/elusivecodes/FrostDateTime/actions/workflows/ci.yml)
4
+ [![codecov](https://codecov.io/gh/elusivecodes/FrostDateTime/branch/main/graph/badge.svg)](https://codecov.io/gh/elusivecodes/FrostDateTime)
4
5
  [![npm version](https://img.shields.io/npm/v/%40fr0st%2Fdatetime?style=flat-square)](https://www.npmjs.com/package/@fr0st/datetime)
5
6
  [![npm downloads](https://img.shields.io/npm/dm/%40fr0st%2Fdatetime?style=flat-square)](https://www.npmjs.com/package/@fr0st/datetime)
6
- [![minzipped size](https://img.shields.io/bundlejs/size/%40fr0st/datetime?format=minzip&style=flat-square)](https://bundlejs.com/?q=@fr0st/datetime)
7
+ [![JS gzip size](https://img.badgesize.io/elusivecodes/FrostDateTime/main/dist/frost-datetime.min.js?compression=gzip&label=JS%20gzip%20size&style=flat-square)](https://github.com/elusivecodes/FrostDateTime/blob/main/dist/frost-datetime.min.js)
7
8
  [![license](https://img.shields.io/github/license/elusivecodes/FrostDateTime?style=flat-square)](./LICENSE)
8
9
 
9
10
  Immutable date and time handling for JavaScript with locale-aware formatting, parsing, calendar math, and IANA or fixed-offset time zones. FrostDateTime works in Node and bundlers, and also ships a browser-friendly UMD bundle that exposes `globalThis.DateTime`.
@@ -11,7 +12,7 @@ Immutable date and time handling for JavaScript with locale-aware formatting, pa
11
12
  ## Highlights
12
13
 
13
14
  - Default ESM `DateTime` export for Node and bundlers
14
- - Browser UMD bundle in `dist/` exposed as `globalThis.DateTime`
15
+ - Prebuilt ESM and UMD bundles in `dist/`
15
16
  - No runtime dependencies
16
17
  - Immutable operations across getters, setters, and date math
17
18
  - Locale-aware formatting, parsing, relative time, and week rules through `Intl`
@@ -32,6 +33,19 @@ FrostDateTime is ESM-only. Import the default `DateTime` export in Node and bund
32
33
  import DateTime from '@fr0st/datetime';
33
34
  ```
34
35
 
36
+ ### Browser (ESM)
37
+
38
+ Import the minified ESM bundle directly from a CDN:
39
+
40
+ ```html
41
+ <script type="module">
42
+ import DateTime from 'https://cdn.jsdelivr.net/npm/@fr0st/datetime@latest/dist/frost-datetime.esm.min.js';
43
+
44
+ const date = DateTime.now({ timeZone: 'UTC' });
45
+ console.log(date.toIsoString());
46
+ </script>
47
+ ```
48
+
35
49
  ### Browser (UMD)
36
50
 
37
51
  Load the bundle from your own copy or a CDN:
@@ -398,7 +412,7 @@ DateTime.clearDataCache();
398
412
 
399
413
  ```bash
400
414
  npm test
401
- npm run js-lint
415
+ npm run lint
402
416
  npm run build
403
417
  ```
404
418