
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@travetto/asset-rest
Advanced tools
Install: @travetto/asset-rest
npm install @travetto/asset-rest
# or
yarn add @travetto/asset-rest
This module provides a clean and direct mechanism for processing uploads, built upon @fastify/busboy. The module also provides some best practices with respect to temporary file deletion.
Once the files are uploaded, they are exposed on RESTful API's request object as req.files
. The uploaded files are constructed as Asset instances, which allows for integration with the Asset module.
A simple example:
Code: Rest controller with upload support
import { Controller, Post, Get, Request } from '@travetto/rest';
import { Asset } from '@travetto/asset';
import { AssetRestUtil, Upload, UploadAll } from '@travetto/asset-rest';
@Controller('/simple')
export class Simple {
@Get('/age')
getAge() {
return { age: 50 };
}
@Post('/age')
getPage() {
return { age: 20 };
}
/**
* @param file A file to upload
*/
@Post('/file')
loadFile(@Upload() file: Asset) {
return AssetRestUtil.downloadable(file);
}
/**
* @param file A file to upload
*/
@Post('/files')
@UploadAll()
loadFiles({ files }: Request) {
for (const [, file] of Object.entries(files)) {
return AssetRestUtil.downloadable(file); // return the first
}
}
}
FAQs
Provides integration between the travetto asset and rest module.
We found that @travetto/asset-rest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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 researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.