
Security News
Static vs. Runtime Reachability: Insights from Latioβs On the Record Podcast
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
cloudku-uploader
Advanced tools
Modern zero-dependency file uploader with auto-conversion, chunked uploads, and TypeScript support. Upload images, videos, audio, and documents to CloudKu with blazing-fast performance.
Next-Generation File Uploader - Zero Dependencies, Maximum Performance
Revolutionary file upload solution built for modern JavaScript environments
π Quick Start β’ π API Docs β’ π‘ Examples β’ π Support
Built with cutting-edge technology for developers who demand excellence
π₯ Performance First
|
β‘ Modern Architecture
|
![]() π Lightning Fast
|
![]() π‘οΈ Enterprise Grade
|
![]() βοΈ Developer Friendly
|
# Using npm
npm install cloudku-uploader
# Using yarn
yarn add cloudku-uploader
# Using pnpm
pnpm add cloudku-uploader
# Using bun
bun add cloudku-uploader
import UploadFile from 'cloudku-uploader'
const uploader = new UploadFile()
// Simple upload
const result = await uploader.upload(fileBuffer, 'image.jpg')
console.log(`π Success: ${result.result.url}`)
// Upload with expiry
const tempResult = await uploader.upload(
fileBuffer,
'temp-file.pdf',
'7d' // Expires in 7 days
)
import express from 'express'
import multer from 'multer'
import UploadFile from 'cloudku-uploader'
const app = express()
const upload = multer({ limits: { fileSize: 100 * 1024 * 1024 } })
const uploader = new UploadFile()
app.post('/api/upload', upload.single('file'), async (req, res) => {
try {
const result = await uploader.upload(
req.file.buffer,
req.file.originalname,
req.body.expiry || null
)
res.json({
status: 'success',
data: {
url: result.result.url,
filename: result.result.filename,
size: result.result.size,
type: result.result.type
}
})
} catch (error) {
res.status(500).json({
status: 'error',
message: error.message
})
}
})
import UploadFile from 'cloudku-uploader'
import { createReadStream, readdirSync } from 'fs'
import { pipeline } from 'stream/promises'
class BatchUploader {
constructor() {
this.uploader = new UploadFile()
this.results = []
}
async uploadDirectory(dirPath, options = {}) {
const files = readdirSync(dirPath)
const { concurrency = 3, expiry = null } = options
console.log(`π¦ Processing ${files.length} files...`)
for (let i = 0; i < files.length; i += concurrency) {
const batch = files.slice(i, i + concurrency)
await Promise.all(
batch.map(async (filename) => {
try {
const buffer = await this.readFileBuffer(`${dirPath}/${filename}`)
const result = await this.uploader.upload(buffer, filename, expiry)
this.results.push({
filename,
url: result.result.url,
status: 'success'
})
console.log(`β
${filename} uploaded successfully`)
} catch (error) {
console.error(`β Failed: ${filename} - ${error.message}`)
this.results.push({
filename,
status: 'failed',
error: error.message
})
}
})
)
}
return this.results
}
async readFileBuffer(filePath) {
return new Promise((resolve, reject) => {
const chunks = []
const stream = createReadStream(filePath)
stream.on('data', chunk => chunks.push(chunk))
stream.on('end', () => resolve(Buffer.concat(chunks)))
stream.on('error', reject)
})
}
}
// Usage
const batchUploader = new BatchUploader()
const results = await batchUploader.uploadDirectory('./uploads', {
concurrency: 5,
expiry: '30d'
})
console.table(results)
// pages/api/upload.js or app/api/upload/route.js
import UploadFile from 'cloudku-uploader'
const uploader = new UploadFile()
export async function POST(request) {
try {
const formData = await request.formData()
const file = formData.get('file')
if (!file) {
return Response.json(
{ error: 'No file provided' },
{ status: 400 }
)
}
const buffer = Buffer.from(await file.arrayBuffer())
const result = await uploader.upload(
buffer,
file.name,
formData.get('expiry') || null
)
return Response.json({
success: true,
data: result.result
})
} catch (error) {
return Response.json(
{ error: error.message },
{ status: 500 }
)
}
}
Unit | Description | Example | Use Case |
---|---|---|---|
s | Seconds | 30s | π₯ Real-time processing |
m | Minutes | 15m | β‘ Temporary previews |
h | Hours | 6h | π Daily reports |
d | Days | 7d | π Weekly backups |
M | Months | 3M | π Quarterly archives |
y | Years | 1y | ποΈ Long-term storage |
class UploadFile {
constructor()
}
upload(fileBuffer, fileName?, expireDate?)
async upload(
fileBuffer: Buffer | Uint8Array,
fileName?: string,
expireDate?: string | null
): Promise<UploadResponse>
Parameters:
fileBuffer
- File data as Buffer or Uint8ArrayfileName
- Optional filename (auto-generated if not provided)expireDate
- Optional expiry duration (e.g., '7d', '1M', '1y')Returns:
interface UploadResponse {
status: 'success' | 'error'
creator?: 'AlfiDev'
information: string
result?: {
filename: string // Generated filename
type: string // MIME type
size: string // File size (formatted)
url: string // Download URL
}
message?: string // Error message (if failed)
}
Category | Formats | Max Size | Optimization |
---|---|---|---|
πΌοΈ Images | JPG, PNG, GIF, WebP, SVG, AVIF, HEIC | 100 MB | β Auto-compression |
π Documents | PDF, DOC(X), TXT, MD, RTF, ODT | 50 MB | β Text extraction |
ποΈ Archives | ZIP, RAR, 7Z, TAR, GZ, BZ2 | 500 MB | β Compression analysis |
π΅ Audio | MP3, WAV, FLAC, AAC, OGG, M4A | 200 MB | β Metadata preservation |
π¬ Video | MP4, AVI, MOV, MKV, WebM, FLV | 1 GB | β Thumbnail generation |
π» Code | JS, TS, PY, GO, RS, C, CPP, JAVA | 10 MB | β Syntax highlighting |
π Modern Browsers
Supporting ES2022+ features |
βοΈ Runtime Environments
Built for modern JavaScript engines |
π¦ Bundle Impact
|
β‘ Speed Metrics
|
π Network Stats
|
π Reliability
|
// Security headers automatically applied
{
'x-content-type-options': 'nosniff',
'x-frame-options': 'DENY',
'x-xss-protection': '0',
'referrer-policy': 'strict-origin-when-cross-origin',
'content-security-policy': 'default-src \'self\'',
'x-provided-by': 'CloudKu-CDN'
}
π Europe β π Americas β π Asia-Pacific
ββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββ
London, UK β New York, US β Tokyo, JP
Frankfurt, DE β Toronto, CA β Singapore, SG
Paris, FR β SΓ£o Paulo, BR β Sydney, AU
Amsterdam, NL β Los Angeles, US β Mumbai, IN
Stockholm, SE β Chicago, US β Seoul, KR
Primary CDN: cloudkuimages.guru
Backup CDN: cloudkuimages-guru.us.itpanel.app
π Performance Enhancements
π§ Developer Experience
|
π New Capabilities
π‘οΈ Security Updates
|
// Old way (v1.x)
const uploader = require('cloudku-uploader')
uploader.upload(buffer, filename, callback)
// New way (v2.x)
import UploadFile from 'cloudku-uploader'
const result = await new UploadFile().upload(buffer, filename)
π Official WebsiteMain platform & documentation |
π¦ NPM RegistryPackage downloads & versions |
π¬ Direct SupportInstant technical assistance |
π§ EnterpriseCustom solutions & SLA |
This project is licensed under the MIT License - see the LICENSE file for details.
npm install cloudku-uploader
Made with β€οΈ by AlfiDev
Empowering developers with reliable, zero-dependency file uploads
β Star us on GitHub β’ π¦ Follow on Twitter β’ π§ Subscribe to Updates
FAQs
Blazing-fast, zero-dependency uploader for CloudKu. Supports auto-conversion, chunked uploads, and TypeScript. Easily upload images, videos, audio, and documents via Node.js.
The npm package cloudku-uploader receives a total of 5,698 weekly downloads. As such, cloudku-uploader popularity was classified as popular.
We found that cloudku-uploader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.