dev-dict 0.11.0 → 0.11.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.
- package/README.md +2 -106
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,35 +9,16 @@
|
|
|
9
9
|
|
|
10
10
|
A community-driven collection of software development terms with explanations in multiple languages. Perfect for building developer tools, documentation sites, educational content and much more.
|
|
11
11
|
|
|
12
|
-
**[Browse All Terms](https://kyco.github.io/dev-dict/)**
|
|
12
|
+
**[Browse All Terms](https://kyco.github.io/dev-dict/)** · **[Documentation](https://kyco.github.io/dev-dict/docs)**
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
### via Package Manager
|
|
17
|
-
|
|
18
16
|
```bash
|
|
19
17
|
npm install dev-dict
|
|
20
18
|
```
|
|
21
19
|
|
|
22
|
-
### via CDN (unpkg)
|
|
23
|
-
|
|
24
|
-
```html
|
|
25
|
-
<script src="https://unpkg.com/dev-dict@latest/dist/dev-dict.min.js"></script>
|
|
26
|
-
<script>
|
|
27
|
-
// Access the library via the global 'devdict' object
|
|
28
|
-
const { terms, utils } = devdict
|
|
29
|
-
|
|
30
|
-
// Translate to specified locale
|
|
31
|
-
const dictionary = utils.getTerms({ terms, locale: 'en-US' })
|
|
32
|
-
|
|
33
|
-
console.log(dictionary)
|
|
34
|
-
</script>
|
|
35
|
-
```
|
|
36
|
-
|
|
37
20
|
## Quick Start
|
|
38
21
|
|
|
39
|
-
### Option 1: All Terms
|
|
40
|
-
|
|
41
22
|
```typescript
|
|
42
23
|
import { terms } from 'dev-dict'
|
|
43
24
|
import { getTerms } from 'dev-dict/utils'
|
|
@@ -52,92 +33,7 @@ dictionary.forEach(term => {
|
|
|
52
33
|
})
|
|
53
34
|
```
|
|
54
35
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
// Import a selection of terms
|
|
59
|
-
import { react, typescript, node_js } from 'dev-dict/terms'
|
|
60
|
-
import { getTerms } from 'dev-dict/utils'
|
|
61
|
-
|
|
62
|
-
// Create a list with only the terms you need
|
|
63
|
-
const terms = { react, typescript, node_js }
|
|
64
|
-
|
|
65
|
-
// Then use the same helper functions as Option 1
|
|
66
|
-
const dictionary = getTerms({ terms, locale: 'en-US' })
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## API Reference
|
|
70
|
-
|
|
71
|
-
### Import Data
|
|
72
|
-
|
|
73
|
-
```typescript
|
|
74
|
-
import { terms, types, tags, locales } from 'dev-dict'
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
| Export | Description |
|
|
78
|
-
|--------|-------------|
|
|
79
|
-
| `terms` | Raw terms dictionary |
|
|
80
|
-
| `types` | Type constants and definitions |
|
|
81
|
-
| `tags` | Tag constants and definitions |
|
|
82
|
-
| `locales` | Locale constants |
|
|
83
|
-
|
|
84
|
-
### Helper Functions
|
|
85
|
-
|
|
86
|
-
Import from `dev-dict/utils`:
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
import {
|
|
90
|
-
getTerms,
|
|
91
|
-
getTermsDict,
|
|
92
|
-
getTypes,
|
|
93
|
-
getTypesDict,
|
|
94
|
-
getTags,
|
|
95
|
-
getTagsDict,
|
|
96
|
-
getSources,
|
|
97
|
-
getSourcesDict
|
|
98
|
-
} from 'dev-dict/utils'
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**Example usage:**
|
|
102
|
-
|
|
103
|
-
```typescript
|
|
104
|
-
// Get terms as an array
|
|
105
|
-
const dictionary = getTerms({
|
|
106
|
-
terms, // Required: the terms dictionary
|
|
107
|
-
locale: 'en-US', // Optional: defaults to 'en-US'
|
|
108
|
-
populateEmpty: true // Optional: defaults to true
|
|
109
|
-
})
|
|
110
|
-
// [{ id: "react", name: "React", ... }, { id: "vue", name: "Vue", ... }]
|
|
111
|
-
|
|
112
|
-
// Get terms as a dictionary object
|
|
113
|
-
const termsDict = getTermsDict({ terms, locale: 'en-US' })
|
|
114
|
-
// { react: { id: "react", name: "React", ... }, vue: { id: "vue", name: "Vue", ... } }
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**Options:**
|
|
118
|
-
|
|
119
|
-
| Parameter | Type | Required | Default | Description |
|
|
120
|
-
|-----------|------|----------|---------|-------------|
|
|
121
|
-
| `terms` | `TTermsDict` | Yes | - | The terms dictionary |
|
|
122
|
-
| `locale` | `string` | No | `'en-US'` | Target locale |
|
|
123
|
-
| `populateEmpty` | `boolean` | No | `true` | Populate empty locale records with en-US values |
|
|
124
|
-
|
|
125
|
-
**Available functions:**
|
|
126
|
-
|
|
127
|
-
| Function | Returns | Description |
|
|
128
|
-
|----------|---------|-------------|
|
|
129
|
-
| `getTermsDict(options)` | `Partial<TTermsDictLocalized>` | Get all terms as a dictionary object |
|
|
130
|
-
| `getTerms(options)` | `TTermLocalized[]` | Get all terms as an array |
|
|
131
|
-
| `getTypesDict(options)` | Dictionary | Get all term types as a dictionary object |
|
|
132
|
-
| `getTypes(options)` | Array | Get all term types as an array |
|
|
133
|
-
| `getTagsDict(options)` | Dictionary | Get all term tags as a dictionary object |
|
|
134
|
-
| `getTags(options)` | Array | Get all term tags as an array |
|
|
135
|
-
| `getSourcesDict(options)` | Dictionary | Get all sources as a dictionary object |
|
|
136
|
-
| `getSources(options)` | Array | Get all sources as an array |
|
|
137
|
-
|
|
138
|
-
### Types
|
|
139
|
-
|
|
140
|
-
See [src/types/index.ts](https://github.com/kyco/dev-dict/blob/main/src/types/index.ts) for all type definitions.
|
|
36
|
+
For detailed API documentation, code examples, and more, visit the **[Documentation](https://kyco.github.io/dev-dict/docs)**.
|
|
141
37
|
|
|
142
38
|
## Supported Languages
|
|
143
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev-dict",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "A community-driven collection of software development terms with explanations in multiple languages. Perfect for building multilingual developer tools, documentation sites, and educational platforms.",
|
|
5
5
|
"author": "Cornelius Weidmann <cornelius@kyco.io> (https://kyco.io)",
|
|
6
6
|
"license": "MIT",
|