# @openstapps/core-converter

> StAppsCore Converter - converter of TypeScript models into JSON schema files

Latest version **0.1.0** (published 2018-11-29) · GPL-3.0-only license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @openstapps/core-converter
pnpm add @openstapps/core-converter
yarn add @openstapps/core-converter
bun add @openstapps/core-converter
```

Provides the command `openstapps-convert`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-11-29 |
| First published | 2018-11-29 |
| Weekly downloads | 0 |
| License | GPL-3.0-only |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 530.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Karl-Philipp Wulfert |
| Maintainers | anselmstordeur, krlwlfrt |
| Keywords | Converter, Core, StApps |

## Links

- npm: https://www.npmjs.com/package/@openstapps/core-converter
- Repository: https://gitlab.com/openstapps/core-converter
- Homepage: https://gitlab.com/openstapps/core-converter#readme
- Issues: https://gitlab.com/openstapps/core-converter/issues
- npm.io page: https://npm.io/package/@openstapps/core-converter

## Dependencies (9)

- [glob](https://npm.io/package/glob.md) 7.1.3
- [async](https://npm.io/package/async.md) 2.6.1
- [commander](https://npm.io/package/commander.md) 2.19.0
- [jsonschema](https://npm.io/package/jsonschema.md) 1.2.4
- [@types/glob](https://npm.io/package/@types/glob.md) 7.1.1
- [@types/node](https://npm.io/package/@types/node.md) 10.12.10
- [@types/async](https://npm.io/package/@types/async.md) 2.0.50
- [@openstapps/logger](https://npm.io/package/@openstapps/logger.md) 0.0.3
- [ts-json-schema-generator](https://npm.io/package/ts-json-schema-generator.md) 0.36.3

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2018-11-29
- 0.0.1 — 2018-11-29

## README

# README

StAppsCore Converter - converter of TypeScript models into JSON schema files

## What is StAppsCore?

The StAppsCore (SC) is a generalized model of data.

SC is based on the idea of [schema.org](https://www.schema.org). The SC structures data by describing objects as so called SC-types like: Event, Place, Date, Person, ...

Data sources of the same type of data are assigned to the same SC-type.

## What is StAppsCore Converter?

The StAppsCore Converter is a tool for converting SC-types (TypeScript) into JSON schema files.

JSON schema files are needed for run-time validation of SC-type objects, as this is a tedious task to do using SC-types defined in TypeScript (not possible without additional coding). That said, StAppsCore Converter practically prepares SC-types to be used for object validation (determining wether an JavaScript/JSON object is a valid object of the corresponding SC-type) using StAppsCore Validator.

## How to use StAppsCore Converter?

Installation of the npm package (using `npm install`) makes the tool available as an executable with the name `stapps-convert`.

The command `stapps-convert` can then be called using 3 required arguments:

```bash
node_modules/.bin/stapps-convert <path> <outdir> <indirs...>
```
where:
- `<path>` is path to the project (where used *.ts files are, e.g. 'src/core',
- `<outdir>` is directory (relative path) to save output files to, e.g. `lib/schema`,
- `<indirs...>` are directories (relative paths) to get source files from, e.g. `src/core/things` `src/core/protocol/`.

Complete command with the example arguments is then:
```bash
node_modules/.bin/stapps-convert src/core lib/schema src/core/things src/core/protocol/
```

Inside of a script in `package.json` or if the npm package is installed globally, the tool `stapps-convert` can be called without its local path (`node_modules/.bin`):

```bash
stapps-convert <path> <outdir> <indirs...>
```

---
_Source: https://npm.io/package/@openstapps/core-converter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
