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