1.0.8 • Published 3 years ago

@islandpenguin/api-typewriter v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

API typewriter

This module can convert an API JSON description into TypeScript typings.

Installation

npm i @islandpenguin/api-typewriter

Configuration

Create file called convert-config.json in your porjects root directory. The file should look like this.

{
    "targetDir": "src/types",
    "src": [
        {
            "url": "http://localhost:3000/api",
            "name": "Api1"
        },
        {
            "url": "http://localhost:3000/api2",
            "name": "Api2"
        }
    ]
}

Execute

Simply call:

node node_modules/@islandpenguin/api-typewriter/index.js

Or create a new script in your package.json file:

"scripts": {
    "update-types": "node node_modules/@islandpenguin/api-typewriter/index.js"
 }