timeprettify 0.0.1 → 0.0.2

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +17 -11
  2. package/LICENSE +21 -21
  3. package/README.md +82 -82
  4. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,11 +1,17 @@
1
- # duration-format
2
-
3
- ## 0.0.1
4
-
5
- ### First Release
6
-
7
- - `format(seconds, options?)` format duration from seconds
8
- - `createFormatter(defaults)` — create reusable formatter with preset options
9
- - Locale support: `en`, `tr`, `ru`
10
- - Styles: `long`, `short`, `narrow`
11
- - `units` option to limit output length
1
+ # duration-format
2
+
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - d0ec928: test ci/cd pipeline
8
+
9
+ ## 0.0.1
10
+
11
+ ### First Release
12
+
13
+ - `format(seconds, options?)` — format duration from seconds
14
+ - `createFormatter(defaults)` — create reusable formatter with preset options
15
+ - Locale support: `en`, `tr`, `ru`
16
+ - Styles: `long`, `short`, `narrow`
17
+ - `units` option to limit output length
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 orazchollaev
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 orazchollaev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,82 +1,82 @@
1
- # timeprettify
2
-
3
- > Lightweight duration formatter with multi-locale support.
4
-
5
- [![npm version](https://img.shields.io/npm/v/timeprettify?color=blue&label=npm)](https://www.npmjs.com/package/timeprettify)
6
- [![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
7
-
8
- ---
9
-
10
- ## Install
11
-
12
- ```bash
13
- pnpm add timeprettify
14
- ```
15
-
16
- ---
17
-
18
- ## Usage
19
-
20
- ```ts
21
- import { format } from 'timeprettify'
22
-
23
- format(3661) // '1 hour 1 minute'
24
- format(3661, { locale: 'tr' }) // '1 saat 1 dakika'
25
- format(3661, { locale: 'ru' }) // '1 час 1 минута'
26
- format(3661, { style: 'short' }) // '1h 1min'
27
- format(3661, { style: 'narrow' }) // '1h1m'
28
- format(3661, { units: 1 }) // '1 hour'
29
- format(3661, { locale: 'tr', style: 'short' }) // '1sa 1dk'
30
- ```
31
-
32
- ---
33
-
34
- ## Options
35
-
36
- | Option | Type | Default | Description |
37
- | -------- | ------------------------------- | -------- | --------------------------- |
38
- | `locale` | `'en' \| 'tr' \| 'ru'` | `'en'` | Output language |
39
- | `style` | `'long' \| 'short' \| 'narrow'` | `'long'` | Format style |
40
- | `units` | `number` | `2` | Max number of units to show |
41
-
42
- ---
43
-
44
- ## Styles
45
-
46
- | Style | Example |
47
- | -------- | ------------------- |
48
- | `long` | `1 hour 30 minutes` |
49
- | `short` | `1h 30min` |
50
- | `narrow` | `1h30m` |
51
-
52
- ---
53
-
54
- ## createFormatter
55
-
56
- Create a reusable formatter with preset options:
57
-
58
- ```ts
59
- import { createFormatter } from 'timeprettify'
60
-
61
- const formatTr = createFormatter({ locale: 'tr' })
62
-
63
- formatTr(3600) // '1 saat'
64
- formatTr(90) // '1 dakika 30 saniye'
65
- formatTr(3600, { style: 'short' }) // '1sa'
66
- ```
67
-
68
- ---
69
-
70
- ## Locales
71
-
72
- | Locale | Language | Plural forms |
73
- | ------ | -------- | ----------------------- |
74
- | `en` | English | singular / plural |
75
- | `tr` | Turkish | no plural |
76
- | `ru` | Russian | singular / few / plural |
77
-
78
- ---
79
-
80
- ## License
81
-
82
- MIT
1
+ # timeprettify
2
+
3
+ > Lightweight duration formatter with multi-locale support.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/timeprettify?color=blue&label=npm)](https://www.npmjs.com/package/timeprettify)
6
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
7
+
8
+ ---
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ pnpm add timeprettify
14
+ ```
15
+
16
+ ---
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { format } from 'timeprettify'
22
+
23
+ format(3661) // '1 hour 1 minute'
24
+ format(3661, { locale: 'tr' }) // '1 saat 1 dakika'
25
+ format(3661, { locale: 'ru' }) // '1 час 1 минута'
26
+ format(3661, { style: 'short' }) // '1h 1min'
27
+ format(3661, { style: 'narrow' }) // '1h1m'
28
+ format(3661, { units: 1 }) // '1 hour'
29
+ format(3661, { locale: 'tr', style: 'short' }) // '1sa 1dk'
30
+ ```
31
+
32
+ ---
33
+
34
+ ## Options
35
+
36
+ | Option | Type | Default | Description |
37
+ | -------- | ------------------------------- | -------- | --------------------------- |
38
+ | `locale` | `'en' \| 'tr' \| 'ru'` | `'en'` | Output language |
39
+ | `style` | `'long' \| 'short' \| 'narrow'` | `'long'` | Format style |
40
+ | `units` | `number` | `2` | Max number of units to show |
41
+
42
+ ---
43
+
44
+ ## Styles
45
+
46
+ | Style | Example |
47
+ | -------- | ------------------- |
48
+ | `long` | `1 hour 30 minutes` |
49
+ | `short` | `1h 30min` |
50
+ | `narrow` | `1h30m` |
51
+
52
+ ---
53
+
54
+ ## createFormatter
55
+
56
+ Create a reusable formatter with preset options:
57
+
58
+ ```ts
59
+ import { createFormatter } from 'timeprettify'
60
+
61
+ const formatTr = createFormatter({ locale: 'tr' })
62
+
63
+ formatTr(3600) // '1 saat'
64
+ formatTr(90) // '1 dakika 30 saniye'
65
+ formatTr(3600, { style: 'short' }) // '1sa'
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Locales
71
+
72
+ | Locale | Language | Plural forms |
73
+ | ------ | -------- | ----------------------- |
74
+ | `en` | English | singular / plural |
75
+ | `tr` | Turkish | no plural |
76
+ | `ru` | Russian | singular / few / plural |
77
+
78
+ ---
79
+
80
+ ## License
81
+
82
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "timeprettify",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Lightweight duration formatter with multi-locale support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",