How deepl/deepl-node works
deepl-node is an official Node.js client for the DeepL API. An application constructs a client with an authentication key, then uses it to submit text or documents for translation and receive parsed results. The SDK also exposes language and usage queries, glossary management, and newer style-rule and translation-memory features. The main runtime layers are the public client/operation classes, HTTP transport, and response parsing. Advanced resource methods and document-minification internals are only partly evidenced by the sampled source, so uncertain internal links are omitted.
Main entry points: translator.ts Translator · deeplClient.ts DeepLClient · client.ts HTTP client · documentMinifier.ts Document minifier
Components 17
Client and translation
- DeepLClient
src/deeplClient.ts - Translator
src/translator.ts - Text translation
src/translator.ts - Document translation
src/translator.ts - Languages and usage
src/translator.ts
API transport
- HTTP client
src/client.ts
Translation resources
- Glossaries
src/deeplClient.ts - Glossary entries
src/glossaryEntries.ts - Style rules
src/deeplClient.ts - Translation memories
src/deeplClient.ts - Document minifier
src/documentMinifier.ts
Shared internals
- Response parsing
src/parsing.ts - API errors
src/errors.ts - Filesystem helper
src/fsHelper.ts - Shared utilities
src/utils.ts
Other components
- Application
- DeepL API
Connections 22
- Application → DeepLClient: constructs and calls
- DeepLClient → Translator: inherits operations
- Application → Translator: constructs and calls
- Translator → Text translation: offers
- Translator → Document translation: offers
- Translator → Languages and usage: offers
- Translator → HTTP client: sends requests
- DeepLClient → HTTP client: sends requests
- HTTP client → DeepL API: sends HTTP
- Translator → Response parsing: parses responses
- DeepLClient → Response parsing: parses responses
- Translator → API errors: raises
- DeepLClient → API errors: raises
- Translator → Glossary entries: serializes entries
- Translator → Glossaries: manages glossaries
- DeepLClient → Glossaries: manages glossaries
- DeepLClient → Style rules: manages rules
- DeepLClient → Translation memories: manages memories
- Document translation → Document minifier: optional preprocessing
- Document minifier → Filesystem helper: uses file operations
- HTTP client → Shared utilities: uses logging and timeout
- Translator → Shared utilities: uses language and stream helpers