
- Complete NestJS TypeScript implementation with WebSocket support - Direct messaging (DM) and group chat functionality - End-to-end encryption with AES encryption and key pairs - Media file support (images, videos, audio, documents) up to 100MB - Push notifications with Firebase Cloud Messaging integration - Mention alerts and real-time typing indicators - User authentication with JWT and Passport - SQLite database with TypeORM entities and relationships - Comprehensive API documentation with Swagger/OpenAPI - File upload handling with secure access control - Online/offline status tracking and presence management - Message editing, deletion, and reply functionality - Notification management with automatic cleanup - Health check endpoint for monitoring - CORS configuration for cross-origin requests - Environment-based configuration management - Structured for Flutter SDK integration Features implemented: ✅ Real-time messaging with Socket.IO ✅ User registration and authentication ✅ Direct messages and group chats ✅ Media file uploads and management ✅ End-to-end encryption ✅ Push notifications ✅ Mention alerts ✅ Typing indicators ✅ Message read receipts ✅ Online status tracking ✅ File access control ✅ Comprehensive API documentation Ready for Flutter SDK development and production deployment.
39 lines
1.9 KiB
Markdown
39 lines
1.9 KiB
Markdown
[](https://github.com/samthor/fast-text-encoding/actions/workflows/node.js.yml)
|
|
|
|
This is a fast polyfill for [`TextEncoder`][1] and [`TextDecoder`][2], which let you encode and decode JavaScript strings into UTF-8 bytes.
|
|
|
|
It is fast partially as it does not support^ any encodings aside UTF-8 (and note that natively, only `TextDecoder` supports alternative encodings anyway).
|
|
See [some benchmarks](https://github.com/samthor/fast-text-encoding/tree/master/bench).
|
|
|
|
^If this polyfill used on Node v5.1 through v11 (when `Text...` was introduced), then this simply wraps `Buffer`, which supports many encodings and is native code.
|
|
|
|
[1]: https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder
|
|
[2]: https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder
|
|
|
|
# Usage
|
|
|
|
Install as "fast-text-encoding" via your favourite package manager.
|
|
|
|
You only need this polyfill if you're supporting older browsers like IE, legacy Edge, ancient Chrome and Firefox, or Node before v11.
|
|
|
|
## Browser
|
|
|
|
Include the minified code inside a `<script>` tag or as an ES6 Module for its side effects.
|
|
It will create `TextEncoder` and `TextDecoder` if the symbols are missing on `window` or `global.`
|
|
|
|
```html
|
|
<script src="node_modules/fast-text-encoding/text.min.js"></script>
|
|
<script type="module">
|
|
import './node_modules/fast-text-encoding/text.min.js';
|
|
import 'fast-text-encoding'; // or perhaps this
|
|
// confidently do something with TextEncoder or TextDecoder \o/
|
|
</script>
|
|
```
|
|
|
|
⚠️ You'll probably want to depend on "text.min.js", as it's compiled to ES5 for older environments.
|
|
|
|
## Not Including Polyfill
|
|
|
|
If your project doesn't need the polyfill, but is included as a transitive dependency, we publish [an empty version](https://www.npmjs.com/package/fast-text-encoding/v/0.0.0-empty) that you could pin NPM or similar's version algorithm to.
|
|
Use "fast-text-encoding@empty".
|