
- 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.
@npmcli/fs
polyfills, and extensions, of the core fs
module.
Features
- all exposed functions return promises
fs.rm
polyfill for node versions < 14.14.0fs.mkdir
polyfill adding support for therecursive
andforce
options in node versions < 10.12.0fs.copyFile
extended to accept anowner
optionfs.mkdir
extended to accept anowner
optionfs.mkdtemp
extended to accept anowner
optionfs.writeFile
extended to accept anowner
optionfs.withTempDir
addedfs.cp
polyfill for node < 16.7.0
The owner
option
The copyFile
, mkdir
, mkdtemp
, writeFile
, and withTempDir
functions
all accept a new owner
property in their options. It can be used in two ways:
{ owner: { uid: 100, gid: 100 } }
- set theuid
andgid
explicitly{ owner: 100 }
- use one value, will set bothuid
andgid
the same
The special string 'inherit'
may be passed instead of a number, which will
cause this module to automatically determine the correct uid
and/or gid
from the nearest existing parent directory of the target.
fs.withTempDir(root, fn, options) -> Promise
Parameters
root
: the directory in which to create the temporary directoryfn
: a function that will be called with the path to the temporary directoryoptions
tmpPrefix
: a prefix to be used in the generated directory name
Usage
The withTempDir
function creates a temporary directory, runs the provided
function (fn
), then removes the temporary directory and resolves or rejects
based on the result of fn
.
const fs = require('@npmcli/fs')
const os = require('os')
// this function will be called with the full path to the temporary directory
// it is called with `await` behind the scenes, so can be async if desired.
const myFunction = async (tempPath) => {
return 'done!'
}
const main = async () => {
const result = await fs.withTempDir(os.tmpdir(), myFunction)
// result === 'done!'
}
main()