New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

generator-yapi-types

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-yapi-types

Convert YAPI interface documents to TypeScript types and API functions

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

generator-yapi-types

将 YAPI 接口文档转换为 TypeScript 类型定义和 API 调用函数的工具。

安装

npm install generator-yapi-types --save-dev
# 或
yarn add generator-yapi-types --dev

使用

1、安装后,用户可以创建一个脚本文件 generate-api.ts

const { generateApi } = require('generator-yapi-types');
const path = require('path');

async function main() {
  await generateApi({
    yapiUrl: 'https://yapi.hdltest.com',
    token: '真实token',
    projectId: '项目id',
    outputDir: path.resolve(__dirname, './src/api')
  });
}

main().catch(console.error);

2、在 package.json 文件中添加以下内容: "generate-api": "node generate-api.ts"

3、运行命令: npm run generate-api

Keywords

yapi

FAQs

Package last updated on 21 Aug 2025

Did you know?

Socket

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.

Install

Related posts