Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guanbinrui/api-cache-codegen
https://github.com/guanbinrui/api-cache-codegen
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/guanbinrui/api-cache-codegen
- Owner: guanbinrui
- Created: 2023-08-18T09:28:43.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-19T08:51:18.000Z (over 1 year ago)
- Last Synced: 2024-10-08T03:40:14.904Z (3 months ago)
- Language: TypeScript
- Size: 140 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Cache Code Generation CLI
[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/guanbinrui/api-cache-codegen)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)> A CLI tool to fetch and cache APIs as static files.
## Installation
```bash
npm install -g api-cache-codegen
```## Usage
```bash
api-cache-process -c config.json
```Replace `api-cache-process` with the actual command to run the CLI tool and `config.json` with the path to your configuration file.
## Configuration
Create a JSON configuration file, e.g., `config.json`, with the following structure:
```json
{
"$schema": "https://raw.githubusercontent.com/guanbinrui/api-cache-codegen/main/schema.json",
"version": 1,
"list": [
{
"$schema": "https://raw.githubusercontent.com/guanbinrui/api-cache-codegen/main/schema.json",
"input": "https://example.com/api.json",
"output": "./cache_generated/",
"generator": {
"src": "./generate_or_fetch_something.js",
"key": "api",
"ttl": 1800
}
}
]
}
```## License
This project is licensed under the MIT License - see the LICENSE file for details.