Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

api-init

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-init

Web engineering project API initialization

Source
npmnpm
Version
1.1.5
Version published
Weekly downloads
30
328.57%
Maintainers
1
Weekly downloads
 
Created
Source

使用

自动

初始化项目 API

npx api-init install [dir] (default: src/api)

生成接口文档

npx api-init docs [dir] (default: src/api)

手动

  • 安装 api-init
npm install api-init --save-dev
  • package.json 添加 npm scripts 命令
// package.json
{
  "scripts": {
    "api-init": "api-init",
  }
}
  • 初始化项目 api ,默认文件(default: src/api)
npm run api-init install [dir] (default: src/api)
  • 生成项目 api 文档 ,默认文件(default: src/api)
npm run api-init docs [dir] (default: src/api)

默认结构

├── src
    ├── api
        ├── docs
            └── index.js         #生成接口文档明显
        ├── modules
            ├── example.js       #接口模块配置
            └── ...
        ├── request
            ├── config.js       #公共请求方法配置
            └── index.js        #封装公共请求方法
        ├── docs.json           #接口文档
        └── index.js            #自动生成接口方法
    ├── ...

文档

https://hugolgw.github.io/api-main

License

MIT

Keywords

api

FAQs

Package last updated on 18 May 2021

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