Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Reduce Tremendous Code Without Third-Party Solution

We’ve all been there: you start a new project, and before you’ve written a single line of business logic, your package.json is already filled with small dependancies, and complex monorepo configurations. While libraries are great, they oft…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

We’ve all been there: you start a new project, and before you’ve written a single line of business logic, your package.json is already filled with small dependancies, and complex monorepo configurations.



While libraries are great, they often come with extra weight and "abstraction tax" that you don't always need.



In this post, I’m sharing couple of lightweight patterns I use to slash boilerplate and remove third-party dependencies in my Next.js and NestJS applications.






1. Fetch Wrapper



If you fetch apis using native apis, you can reduce a lot of code by using this wrapper




// lib/api-client.ts
import Cookies from "js-cookie";

const baseUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000";

export async function clientFetch<T>(
endpoint: string,
options: RequestInit = {},
): Promise<T> {
const token = Cookies.get("token");

const headers: Record<string, string> = {
"Content-Type": "application/json",
...(token && { Authorization: `Bearer ${token}` }),
...(options.headers as Record<string, string>),
};

if (options.body instanceof FormData) {
delete headers["Content-Type"];
}

const response = await fetch(`${baseUrl}${endpoint}`, {
...options,
headers,
});

if (!response.ok) {
const error = await response.json();
throw new Error(error.message);
}

return response.json();
}






Use examples




// favorites.service.ts
export const favoritesService = {
getAll: () => clientFetch<IProduct[]>("/favorites"),
createOne: (productId: string) =>
clientFetch<IProduct>(`/favorites/${productId}`, { method: "POST" }),
removeOne: (productId: string) =>
clientFetch<null>(`/favorites/${productId}`, { method: "DELETE" }),
};









2. JavaScript Object to formdata



Do you find yourself appending object keys and values manually to convert javascript objects to formdata? Which result in ugly and unmaintainable code? Use this instead




// utils/helper.ts
export function jsonToFormData(data: any) {
const formData = new FormData();

buildFormData(formData, data);

return formData;
}

function buildFormData(formData: any, data: any, parentKey?: any) {
if (
data &&
typeof data === "object" &&
!(data instanceof Date) &&
!(data instanceof File) &&
!(data instanceof Blob)
) {
Object.keys(data).forEach((key) => {
buildFormData(
formData,
data[key],
parentKey ? `${parentKey}[${key}]` : key,
);
});
} else {
const value = data == null ? "" : data;

formData.append(parentKey, value);
}
}







Use examples




// products.service.ts
export const productsService = {
create: (product: ICreateProduct) => {
const formData = jsonToFormData(product);

return clientFetch<IProduct>("/products", {
method: "POST",
body: formData,
});
},
updateOne: (id: string, product: IUpdateProduct) => {
const formData = jsonToFormData(product);

return clientFetch<IProduct>(`/products/${id}`, {
method: "PATCH",
body: formData,
});
},
};









3. Duplicate Interfaces



Do you see yourself duplicating interfaces between front-end and back-end? Well you may know about monorepo tools like Turborepo, Nx. But you don’t want to introduce that much complexity to just share the typescript files. Do this.



I assume you are using Next.js and NestJS directory as following




/api/
/web/
/shared/
/src/
user.type.ts
product.type.ts






Add this tsconfig.ts to your Next.js and NestJS




// web/tsconfig.json
{
"compilerOptions": {
"paths": {
"@shared/types/*": ["../shared/src/*"]
}
},
"include": [
"../shared/src/**/*"
],
}






Then you can import them




import { User, CreateUser, UpdateUser } from "@shared/user.type";
import { Product, CreateProduct, UpdateProduct } from "@shared/product.type";









4. Class Merging



If you are tired of long string concatenations for CSS classes but don't want a library




// lib/utils.ts
export function cn(...classes: (string | boolean | undefined)[]) {
return classes.filter(Boolean).join(" ");
}






Use examples




// Before
<button className={`btn ${active ? 'btn-active' : ''} ${disabled ? 'btn-disabled' : ''}`}>
Submit
</button>

// After
<button className={cn("btn", active && "btn-active", disabled && "btn-disabled")}>
Submit
</button>









Wrapping Up



By leaning on the native Fetch API, recursive FormData builders, and TypeScript’s path mapping, you can keep your architecture lean and your bundle size small. You don’t always need a 50kb library to handle a task that a 20-line utility function can do better.



What about you? Are there any third-party libraries you’ve successfully replaced with native code recently? I’d love to hear your favorite "vanilla" hacks in the comments below!

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Reduce Tremendous Code Without Third-Party Solution
id: 8afbd1e5-385d-4159-9c8c-573146c1c20f
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-27
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-27"
        description = "YARA Signature for "
    strings:
        $str = "Reduce Tremendous Code Without" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Reduce Tremendous Code Without Third-Par")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Reduce Tremendous Code Without Third-Par*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Reduce Tremendous Code Without Third-Par"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Analyse für identifizierte Bedrohung auf Basis von Live-CTI (ENISA EUVD): CVSS 0.0 · EPSS 0.0% · CISA KEV: nein. Handlungsableitung aus den verlinkten Hersteller-Quellen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Reduce Tremendous Code Without Third-Party Solution

Thematisch verwandte Begriffe: Reduce, Tremendous, Code, Without · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100739 | A vulnerability was detected in mathurvishal CloudClassroom-PHP-Project…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag