
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
koatty_cli
Advanced tools
Koatty command line tool.
koatty new projectName
cd ./projectName
yarn install // or npm i
npm start
// http controller
kt controller test
// grpc controller
kt controller -t grpc test
// websocket controller
kt controller -t websocket test
kt service test
// service with interface
kt service -i test
kt middleware test
//default use typeorm
kt model test
定义切面类:
kt aspect test
使用切面:
@Controller()
@BeforeEach("TestAspect") //类的每一个方法执行之前执行
export class TestController {
app: App;
@RequestMapping("/test", RequestMethod.ALL)
@After("TestAspect") //test方法执行之前执行
async test() {
const info = await this.testService.test();
return this.body(info);
}
}
定义数据验证类:
kt dto test
修改数据验证类:
export class TestDTO {
@IsNotEmpty()
name: string;
@Min(0)
@Max(120)
age: number;
}
使用实体类进行验证:
@Controller()
export class TestController {
app: App;
@RequestMapping("/test", RequestMethod.ALL)
@Validated() // <== 开启验证
async test(@Get() param: TestDTO) { // <== 指定DTO
const info = await this.testService.test();
return this.body(info);
}
}
kt new projectName -t middleware
cd ./projectName
yarn install // or npm i
npm start
kt new projectName -t plugin
cd ./projectName
yarn install // or npm i
npm start
FAQs
Koatty command line tool.
The npm package koatty_cli receives a total of 5 weekly downloads. As such, koatty_cli popularity was classified as not popular.
We found that koatty_cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.