Skip to content

Commit 652c296

Browse files
committed
WIP integrating json-schema-fns and starting to test
1 parent 0c110bd commit 652c296

9 files changed

Lines changed: 580 additions & 27 deletions

File tree

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
# Typescript Node Package Repository Template
1+
# JSON Schema Infer
22

3-
> Create a new repo from this template to get started creating a Typescript npm package
3+
> Infers JSON Schemas and Type Definitions from example JSON
44
55
<!-- ![Coverage lines](./badges/badge-lines.svg) -->
6-
<!-- ![Tests](https://github.com/jsonhero-io/ts-node-package-template/actions/workflows/test.yml/badge.svg?branch=main) -->
7-
<!-- [![Downloads](https://img.shields.io/npm/dm/%40jsonhero%2Fts-node-package-template.svg)](https://npmjs.com/@jsonhero/ts-node-package-template) -->
8-
<!-- [![Install size](https://packagephobia.com/badge?p=%40jsonhero%2Fts-node-package-template)](https://packagephobia.com/result?p=@jsonhero/ts-node-package-template) -->
6+
<!-- ![Tests](https://github.com/jsonhero-io/schema-infer/actions/workflows/test.yml/badge.svg?branch=main) -->
7+
<!-- [![Downloads](https://img.shields.io/npm/dm/%40jsonhero%2Fschema-infer.svg)](https://npmjs.com/@jsonhero/schema-infer) -->
8+
<!-- [![Install size](https://packagephobia.com/badge?p=%40jsonhero%2Fschema-infer)](https://packagephobia.com/result?p=@jsonhero/schema-infer) -->
99

1010
## Features
1111

1212
- Written in typescript
13-
- Github workflows for running tests and publishing package to NPM on Github release
14-
- ts-node and ts-jest integration
15-
- Generate coverage badges
16-
- ESLint with Typescript and prettier support
17-
- Pre-commit hooks to format code with prettier and run ESLint
13+
- Infers JSON Schema
14+
- Supports most string formats through [json-infer-types](https://github.com/jsonhero-io/json-infer-types)
15+
- Date and times
16+
- URIs
17+
- Email Addresses
18+
- Hostnames
19+
- IP Addresses
20+
- uuids
21+
- Infers JSON Type definitions
22+
- Supports hints for discriminators (tagged unions), value-only schemas, and enums
23+
- Provide with multiple JSON documents to improve inference
1824

1925
## Usage
20-
21-
Create a new repository from this template on Github with the [following instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)

package-lock.json

Lines changed: 98 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,9 @@
6464
"hooks": {
6565
"pre-commit": "npm run prettier-format && npm run lint"
6666
}
67+
},
68+
"dependencies": {
69+
"@jsonhero/json-infer-types": "1.0.5",
70+
"ts-pattern": "^3.3.4"
6771
}
6872
}

0 commit comments

Comments
 (0)