1.1.6 • Published 4 years ago

dto-to-ts-cli v1.1.6

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

C# models to TypeScript

This is a soft fork of James Loyd's csharp-models-to-typescript-enhanced npm package. The main difference is that we change according angular coding style

Dependencies

Install

$ npm install --save dto-to-ts-cli

How to use

  1. Add a config file to your project that contains for example...
{
    "include": [
        "./models/**/*.cs",
        "./enums/**/*.cs"
    ],
    "exclude": [
        "./models/foo/bar.cs"
    ],
    "namespace": "Api",
    "output": "./models",
    "camelCase": false,
    "camelCaseEnums": false,
    "numericEnums": false,
    "stringLiteralTypesInsteadOfEnums": false,
    "customTypeTranslations": {
        "ProductName": "string",
        "ProductNumber": "string"
    }
}
  1. Add a npm script to your package.json that references your config file...
"scripts": {
    "generate-types": "node node_modules\\dto-to-ts-cli\\index.js --config=your-config-file.json"
},
  1. Run the npm script generate-types and the output file specified in your config should be created and populated with your models.

License

MIT © Jonathan Persson, Armstrong DevTeam

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago