0.1.0 • Published 2 years ago

typescript-types-separator v0.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Break your single Types file into many separate ones

This lib was built to help out when you want to keep a certain standard for your type files, but they are generated by a tool that does not support separating a single type per file. A concrete example is that when I was building a service using OpenAPI yaml, I wanted to code once, and have my typescript files updated. But the tool to output the types only does it for a single file.

Usage

You can use a config file currently to setup source and output. Just place a json file named "types-separator.json" on the root where the command should run, and it will be picked up. Please follow this format:

  {
    "source": "../path/to/your/source/files",
    "output": "../path/for/output/",
    "formatCode": true
  }
  • formatCode currently is a flag to run prettier on the resulting code;
  • Tests have not been implemented yet;