Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@web-lite/storage
Advanced tools
TypeScript client for Weblite S3 Storage
declare const upload: (file: File, { name, type, meta, compression, onProgress, }?: {
name?: string; // default: file.name
type?: 'file' | 'voice' | 'image' | 'infer'; // default: `file`
meta?: Record<string, unknown>; // use it carefully!
compression?: CompressorOptions; // applied only if `type` = `image`, will be passed to compressorjs
onUploadSubmit?: (fileId: string) => void, // called when the upload is submitted in the queue
onUploadStart?: (fileId: string) => void, // called when the upload is started
onProgress?: (fileId: string, { sent, total }: {
sent: number;
total: number;
}) => void;
}) => Promise<{
fileId: string;
fileName: string;
size: number;
type: 'file' | 'voice' | 'image';
contentType: string;
createdAt: Date;
}>
/*
returns `true` if successfully canceled
returns `false` if:
- file has been completely uploaded
- file has been already canceled
- fileId is not valid
*/
declare const cancelUpload: (fileId: string) => boolean
// returns direct download link
declare const getDirectLink: (fileId: string) => string
declare const getInfo: (fileId: string) => Promise<{
fileName: string;
size: number;
contentType: string;
meta: Record<string, unknown>;
directLink: string;
}>
declare const config: (values: {
fileServiceUrl?: string
s3Url?: string
authToken?: string
}) => void
import * as storage from '@web-lite/storage'
storage.config({ authToken: 'yourAuthToken' })
const uploadImage = async (image: File): Promise<void> => {
const { fileId } = await storage.upload(image, {
type: 'image',
compression: { quality: 0.5 },
})
const info = await storage.getInfo(fileId)
console.log(info)
}
const image = selectImage()
uploadImage(image)
FAQs
TypeScript client for Weblite S3 Storage
The npm package @web-lite/storage receives a total of 0 weekly downloads. As such, @web-lite/storage popularity was classified as not popular.
We found that @web-lite/storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.