Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
koatty_cli
Advanced tools
Koatty command line tool.
koatty new projectName
cd ./projectName
yarn install // or npm i
npm start
koatty controller test
koatty service test
koatty middleware test
//default use thinkorm
koatty model test
//use typeorm
koatty model -o typeorm test
定义切面类:
koatty aspect test
使用切面:
@Controller()
@BeforeEach("TestAspect") //类的每一个方法执行之前执行
export class TestController extends BaseController {
app: App;
@RequestMapping("/test", RequestMethod.ALL)
@After("TestAspect") //test方法执行之前执行
async test() {
const info = await this.testService.test();
return this.body(info);
}
}
定义数据验证类:
koatty dto test
修改数据验证类:
export class TestDTO {
@IsNotEmpty()
name: string;
@Min(0)
@Max(120)
age: number;
}
使用实体类进行验证:
@Controller()
export class TestController extends BaseController {
app: App;
@RequestMapping("/test", RequestMethod.ALL)
@Validated() // <== 开启验证
async test(@Get() param: TestDTO) { // <== 指定DTO
const info = await this.testService.test();
return this.body(info);
}
}
koatty new projectName -t middleware
cd ./projectName
yarn install // or npm i
npm start
koatty 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 109 weekly downloads. As such, koatty_cli popularity was classified as not popular.
We found that koatty_cli demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.