JavaScript Minifier
FreeMinify JavaScript code by removing comments and whitespace to reduce bundle size.
Saved 295 bytes (34% smaller)
874 bytes579 bytes
Input JS874 bytes
Minified Output579 bytes
function authenticateUser(email,password){if (!email||!password){throw new Error('Email and password are required');}const normalizedEmail=email.toLowerCase().trim();const hashedPassword=hashPassword(password);return fetch('/api/auth/login',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({email:normalizedEmail,password:hashedPassword})}).then(response=>{if (!response.ok){throw new Error('Authentication failed');}return response.json();}).then(data=>{localStorage.setItem('token',data.token);return data.user;});}export default authenticateUser;
874 B
Original
579 B
Minified
295 B
Saved
34%
Reduction
About JavaScript Minifier
Remove comments, whitespace and unnecessary characters from JavaScript files to reduce bundle size for faster page loads. Handles both single-line and multi-line comments, preserves string literals and restores keyword spacing for valid output. Also works as a beautifier to expand minified JS back to readable format.
Reviews
Sign in to write a review