taraskevizer 0.0.3 → 1.0.1

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 (2) hide show
  1. package/README.md +109 -0
  2. package/package.json +6 -3
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ ## Install
2
+
3
+ ```
4
+ $ npm i taraskevizer
5
+ ```
6
+
7
+ ## Usage
8
+
9
+ ```js
10
+ import { taraskSync, tarask } from 'taraskevizer';
11
+
12
+ const result = taraskSync(text);
13
+ // or
14
+ const result = await tarask(text);
15
+ ```
16
+
17
+ ## API
18
+
19
+ ### tarask(text, options?)
20
+
21
+ Returns a `Promise<string>`
22
+
23
+ ### taraskSync(text, options?)
24
+
25
+ Returns a `string`
26
+
27
+ #### text
28
+
29
+ Type: `string`
30
+
31
+ ## Options
32
+
33
+ Type: `object`
34
+
35
+ ### abc
36
+
37
+ Type: `number`
38
+
39
+ Default value: `0`
40
+
41
+ Alphabet of output text:
42
+ 0. cyrillic
43
+ 1. latin
44
+ 2. arabic
45
+
46
+ ### j
47
+
48
+ Type: `number`
49
+
50
+ Default value: `0`
51
+
52
+ When to replace `і`(`i`) by `й`(`j`) after vowels:
53
+ 0. never
54
+ 1. random
55
+ 2. always
56
+
57
+ ### html
58
+
59
+ Type: `false|object`
60
+
61
+ Default value: `false`
62
+
63
+ If `object`, some parts of a text are wrapped in HTML tags.
64
+
65
+ #### g
66
+
67
+ Type: `boolean`
68
+
69
+ Default value: `false`
70
+
71
+ Do replace `г`(`h`) by `ґ`(`g`) in cyrillic alphabet?
72
+
73
+ ```html
74
+ false: <tarH>г</tarH> <tarH>Г</tarH> true: <tarH>ґ</tarH> <tarH>Ґ</tarH>
75
+ ```
76
+
77
+ ## HTML tags
78
+
79
+ ### tarF
80
+
81
+ Difference between an input and an output word.
82
+
83
+ ```html
84
+ <tarF>this_part_of_word_is_fixed</tarF>
85
+
86
+ пл<tarF>я</tarF>н
87
+ ```
88
+
89
+ ### tarL
90
+
91
+ A part of a word wrapped in this tag is variable,
92
+ variations are mentioned in a `data-l` attribute
93
+ and are separated by commas
94
+
95
+ ```html
96
+ <tarL data-l="variation2,variation3">variation1</tarL>
97
+
98
+ <tarL data-l="Горадня">Гродна</tarL>
99
+ ```
100
+
101
+ ### tarH
102
+
103
+ Can be replaced by `ґ`(`g`) letter. appears only if alphabet is cyrillic
104
+
105
+ ```html
106
+ <tarH>г</tarH>
107
+
108
+ <tarH>Г</tarH>валт
109
+ ```
package/package.json CHANGED
@@ -2,17 +2,19 @@
2
2
  "name": "taraskevizer",
3
3
  "author": "GooseOb",
4
4
  "license": "MIT",
5
- "version": "0.0.3",
5
+ "version": "1.0.1",
6
6
  "private": false,
7
7
  "homepage": "https://gooseob.github.io/taraskevizatar/",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",
10
10
  "types": "dist/index.d.ts",
11
11
  "files": [
12
- "dist/**/*"
12
+ "dist/**/*",
13
+ "README.md"
13
14
  ],
14
15
  "scripts": {
15
- "build": "tsup --config build-config/index.js"
16
+ "build": "tsup --config build-config/index.js",
17
+ "prepare": "husky install"
16
18
  },
17
19
  "repository": {
18
20
  "type": "git",
@@ -26,6 +28,7 @@
26
28
  "belarusian"
27
29
  ],
28
30
  "devDependencies": {
31
+ "husky": "^8.0.3",
29
32
  "prettier": "^3.0.0",
30
33
  "tsup": "^6.5.0",
31
34
  "typescript": "^4.9.4"