@leandrommedeiros/ts-json-sampler
v0.0.8
Published
Generates sample JSON for selected types
Downloads
369
Maintainers
Readme
ts-json-sampler
ts-json-sampler
is a TypeScript library and CLI tool that generates sample JSON for selected types. It is designed to be used both as a command-line tool and as a library in TypeScript/JavaScript projects.
Features
- Generate sample JSON for TypeScript types.
- Use as a CLI tool or integrate into your TypeScript/JavaScript projects.
- Supports custom type definitions and configurations.
Installation
You can install ts-json-sampler
via npm:
npm install -g @leandrommedeiros/ts-json-sampler
Usage
CLI
To use ts-json-sampler
as a CLI tool, run:
ts-json-sampler --entity-path <path> --root-app-path <path> --tsconfig-path <path> --output-path <path>
Library
To use ts-json-sampler
in your TypeScript/JavaScript project:
import { SamplerService } from '@leandrommedeiros/ts-json-sampler';
// Example usage
const samplerService = new SamplerService(inputTypes);
const samples = samplerService.generateForAll();
console.log(samples);
Configuration
For detailed configuration options, refer to the Configuration Guide.
Contributing
Contributions are welcome! Please read our Contributing Guide to get started.
License
This project is licensed under the BSD 2-Clause License. See the LICENSE file for details.
Acknowledgments
Special thanks to all contributors and the open-source community for their support.