express-project-builder 1.0.21 → 1.0.23

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 +48 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -676,3 +676,51 @@ delete_cache_from_RAM("user:123"); // 1 (deleted)
676
676
  // Clear all cache
677
677
  clear_all_cache(); // Removes all entries
678
678
  ```
679
+
680
+ - /src/utils/**removeUploadedFiles.ts** <br/>
681
+ Utility functions for cleaning up uploaded files from local storage after cloud upload or error handling.
682
+
683
+ ```typescript
684
+ // In your service file or any file
685
+ import {
686
+ removeSingleUploadedFile,
687
+ removeUploadedFiles,
688
+ removeFilesFromFields,
689
+ cleanUploadDirectory,
690
+ } from "../../utils/removeUploadedFiles";
691
+
692
+ // Remove a single file
693
+ await removeSingleUploadedFile("/path/to/file.jpg");
694
+
695
+ // Remove all uploaded files from multer request
696
+ await removeUploadedFiles(req.files);
697
+
698
+ // Remove files from specific fields only
699
+ await removeFilesFromFields(req.files, ["images", "documents"]);
700
+
701
+ // Clean entire upload directory
702
+ await cleanUploadDirectory("/path/to/uploads");
703
+ ```
704
+
705
+ - /src/utils/**sendEmail.ts** <br/>
706
+ Utility functions for sending emails using Nodemailer with HTML content, attachments, and error handling.
707
+
708
+ ```typescript
709
+ // In your service file or any file
710
+ import sendEmail, { testEmailConfig } from "../../utils/sendEmail";
711
+ import { TEmailFormat } from "../../interfaces/emailFormat";
712
+
713
+ // Send email with HTML content
714
+ const emailTemplate: TEmailFormat = {
715
+ subject: "Welcome to Our Platform",
716
+ emailBody: `
717
+ <h1>Welcome!</h1>
718
+ <p>Thank you for joining our platform.</p>
719
+ `,
720
+ };
721
+
722
+ await sendEmail(payload.email, emailTemplate);
723
+
724
+ // Test email configuration
725
+ await testEmailConfig();
726
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-project-builder",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "A powerful and professional Express.js project generator CLI that instantly scaffolds a production-ready backend with TypeScript, modular architecture, and built-in support for MongoDB (Mongoose) or PostgreSQL (Prisma). Includes authentication, error handling, rate limiting, file upload, caching, and utility functions—so you can focus on building features instead of boilerplate. Perfect for kickstarting your next Express.js API project with best practices and modern tools.",
5
5
  "type": "module",
6
6
  "main": "dist/bin/index.js",