dev-dict 0.4.5 → 0.4.6

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 +207 -40
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,65 +1,232 @@
1
1
  # dev-dict
2
2
 
3
- A dictionary of software related terms.
3
+ > A multilingual dictionary of software development terms
4
4
 
5
- This package aims to provide an exhaustive list of software industry related terms with simple explanations - and in multiple languages.
5
+ [![npm version](https://img.shields.io/npm/v/dev-dict.svg)](https://www.npmjs.com/package/dev-dict)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
7
 
7
- A list of available terms can be found here:
8
- - [Terms](./docs/TERMS.md)
8
+ **dev-dict** provides an exhaustive, community-driven collection of software industry terms with clear explanations in multiple languages. Perfect for developers, technical writers, educators, and anyone building multilingual developer tools.
9
9
 
10
- Supported languages:
11
- - [Languages](./data/locales/index.ts)
10
+ ---
12
11
 
12
+ ## Features
13
13
 
14
- ## Installation
14
+ - **Multilingual Support** - Terms available in English (US/GB), German, and more
15
+ - **Type-Safe** - Built with TypeScript for excellent IDE support
16
+ - **Flexible API** - Access localised strings or raw translation objects
17
+ - **Comprehensive** - Covering frameworks, libraries, languages, tools, and concepts
18
+ - **Lightweight** - Tree-shakeable ESM and UMD builds
19
+ - **Extensible** - Easy to contribute new terms and translations
15
20
 
16
- ```bash
17
- npm i dev-dict
18
- ```
21
+ ---
22
+
23
+ ## Quick Start
19
24
 
25
+ ### Installation
20
26
 
21
- ## Usage
27
+ ```bash
28
+ npm install dev-dict
29
+ # or
30
+ pnpm add dev-dict
31
+ # or
32
+ yarn add dev-dict
33
+ ```
22
34
 
23
- By default the dictionary is localised and defaults to "en-US".
35
+ ### Basic Usage
24
36
 
25
37
  ```typescript
26
38
  import { getTerm, getTerms, getDict } from 'dev-dict'
27
39
 
28
- /**
29
- * Get dictionary
30
- */
31
- const dd = getDict({ locale: 'en-US' })
32
- console.log(dd.react.label) // "JavaScript Library"
33
-
34
- /**
35
- * Get dictionary (raw)
36
- */
37
- const ddRaw = getDict({ localized: false })
38
- console.log(ddRaw.react.label) // { "en-US": "JavaScript Library", "de-DE": "JavaScript-Bibliothek", ... }
39
-
40
- /**
41
- * Get a single term
42
- */
40
+ // Get a single term
41
+ const react = getTerm({ id: 'react', locale: 'en-US' })
42
+ console.log(react.label) // "JavaScript Library"
43
+ console.log(react.definition) // "A JavaScript library for building user interfaces..."
44
+
45
+ // Get all terms as an array
46
+ const terms = getTerms({ locale: 'en-US' })
47
+ console.log(terms) // [{ id: "react", name: "React", ... }, ...]
48
+
49
+ // Get dictionary object (keyed by ID)
50
+ const dict = getDict({ locale: 'en-US' })
51
+ console.log(dict.react.label) // "JavaScript Library"
52
+ console.log(dict.typescript.label) // "Programming Language"
53
+ ```
54
+
55
+ ---
56
+
57
+ ## API Reference
58
+
59
+ ### `getTerm(options)`
60
+
61
+ Get a single term by ID.
62
+
63
+ ```typescript
64
+ // Localised (default)
43
65
  const reactEn = getTerm({ id: 'react', locale: 'en-US' })
44
- const reactDe = getTerm({ id: 'react', locale: 'de-DE' })
45
66
  console.log(reactEn.label) // "JavaScript Library"
67
+
68
+ const reactDe = getTerm({ id: 'react', locale: 'de-DE' })
46
69
  console.log(reactDe.label) // "JavaScript-Bibliothek"
47
70
 
48
- /**
49
- * Get a single term (raw)
50
- */
71
+ // Raw (all translations)
51
72
  const reactRaw = getTerm({ id: 'react', localized: false })
52
- console.log(reactRaw.label) // { "en-US": "JavaScript Library", "de-DE": "JavaScript-Bibliothek", ... }
73
+ console.log(reactRaw.label)
74
+ // { "en-US": "JavaScript Library", "de-DE": "JavaScript-Bibliothek", ... }
75
+ ```
53
76
 
54
- /**
55
- * Get all terms
56
- */
77
+ **Options:**
78
+ - `id: string` - Term identifier (required)
79
+ - `locale?: string` - Target locale (default: `'en-US'`)
80
+ - `localized?: boolean` - Return localised strings (default: `true`)
81
+ - `useFallback?: boolean` - Fall back to en-US for missing translations (default: `true`)
82
+
83
+ ---
84
+
85
+ ### `getTerms(options)`
86
+
87
+ Get all terms as an array.
88
+
89
+ ```typescript
90
+ // Localised
57
91
  const terms = getTerms({ locale: 'en-US' })
58
- console.log(terms) // [{ id: "react", label: "JavaScript Library" }, ... ]
92
+ console.log(terms) // [{ id: "react", label: "JavaScript Library" }, ...]
59
93
 
60
- /**
61
- * Get all terms (raw)
62
- */
94
+ // Raw
63
95
  const termsRaw = getTerms({ localized: false })
64
- console.log(termsRaw) // [{ id: "react", label: { "en-US": "JavaScript Library", "de-DE": "JavaScript-Bibliothek", ... } }, ... ]
96
+ console.log(termsRaw)
97
+ // [{ id: "react", label: { "en-US": "...", "de-DE": "..." } }, ...]
98
+ ```
99
+
100
+ **Options:**
101
+ - `locale?: string` - Target locale (default: `'en-US'`)
102
+ - `localized?: boolean` - Return localised strings (default: `true`)
103
+ - `useFallback?: boolean` - Fall back to en-US for missing translations (default: `true`)
104
+
105
+ ---
106
+
107
+ ### `getDict(options)`
108
+
109
+ Get dictionary as an object keyed by term ID.
110
+
111
+ ```typescript
112
+ // Localised
113
+ const dict = getDict({ locale: 'en-US' })
114
+ console.log(dict.react.label) // "JavaScript Library"
115
+
116
+ // Raw
117
+ const dictRaw = getDict({ localized: false })
118
+ console.log(dictRaw.react.label)
119
+ // { "en-US": "JavaScript Library", "de-DE": "JavaScript-Bibliothek", ... }
120
+ ```
121
+
122
+ **Options:**
123
+ - `locale?: string` - Target locale (default: `'en-US'`)
124
+ - `localized?: boolean` - Return localised strings (default: `true`)
125
+ - `useFallback?: boolean` - Fall back to en-US for missing translations (default: `true`)
126
+
127
+ ---
128
+
129
+ ### `getTypes(options)`
130
+
131
+ Get all term types (e.g., library, framework, language).
132
+
133
+ ```typescript
134
+ const types = getTypes({ locale: 'en-US' })
135
+ console.log(types)
136
+ // [{ id: "library", name: "Library" }, { id: "framework", name: "Framework" }, ...]
65
137
  ```
138
+
139
+ ---
140
+
141
+ ### `getTags(options)`
142
+
143
+ Get all term tags (e.g., frontend, backend, open_source).
144
+
145
+ ```typescript
146
+ const tags = getTags({ locale: 'en-US' })
147
+ console.log(tags)
148
+ // [{ id: "frontend", name: "Frontend" }, { id: "backend", name: "Backend" }, ...]
149
+ ```
150
+
151
+ ---
152
+
153
+ ## Supported Languages
154
+
155
+ | Locale | Language | Status |
156
+ |--------|----------|--------|
157
+ | `en-US` | English (United States) | ✅ Primary (all terms) |
158
+ | `en-GB` | English (Great Britain) | ✅ Supported |
159
+ | `de-DE` | German (Germany) | ✅ Supported |
160
+
161
+ Want to add a new language? Check out the [Contributing Guide](./CONTRIBUTING.md#adding-a-new-language).
162
+
163
+ ---
164
+
165
+ ## Browse Available Terms
166
+
167
+ Explore the full catalogue of terms, types, and tags:
168
+
169
+ - **[Terms](./docs/TERMS.md)** - All software development terms
170
+ - **[Types](./docs/TYPES.md)** - Term categories (library, framework, etc.)
171
+ - **[Tags](./docs/TAGS.md)** - Additional classifications (frontend, backend, etc.)
172
+
173
+ ---
174
+
175
+ ## Contributing
176
+
177
+ We welcome contributions! Whether you want to:
178
+ - Add a new term
179
+ - Provide translations
180
+ - Fix errors or typos
181
+ - Suggest improvements
182
+
183
+ Please read our [Contributing Guide](./CONTRIBUTING.md) to get started.
184
+
185
+ ---
186
+
187
+ ## Development
188
+
189
+ ```bash
190
+ # Install dependencies
191
+ pnpm install
192
+
193
+ # Start dev server (serves examples/)
194
+ pnpm dev
195
+
196
+ # Build library
197
+ pnpm build
198
+
199
+ # Lint code
200
+ npx eslint .
201
+
202
+ # Format code
203
+ npx prettier --write .
204
+ ```
205
+
206
+ For detailed development guidance, see [CLAUDE.md](./CLAUDE.md).
207
+
208
+ ---
209
+
210
+ ## Use Cases
211
+
212
+ - **Documentation Sites** - Display term definitions with automatic localisation
213
+ - **Educational Platforms** - Teach developers in their native language
214
+ - **Developer Tools** - Add contextual help for technical terms
215
+ - **Content Management** - Maintain consistent terminology across translations
216
+ - **IDE Extensions** - Provide inline term explanations
217
+
218
+ ---
219
+
220
+ ## License
221
+
222
+ [MIT](./LICENSE) © [Cornelius Weidmann](https://github.com/kyco)
223
+
224
+ ---
225
+
226
+ ## Links
227
+
228
+ - [npm Package](https://www.npmjs.com/package/dev-dict)
229
+ - [GitHub Repository](https://github.com/kyco/dev-dict)
230
+ - [Issue Tracker](https://github.com/kyco/dev-dict/issues)
231
+ - [Discussions](https://github.com/kyco/dev-dict/discussions)
232
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-dict",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "A dictionary of software related terms. Supports multiple languages.",
5
5
  "author": "Cornelius Weidmann <cornelius@kyco.io> (https://kyco.io)",
6
6
  "license": "MIT",