Socket
Book a DemoInstallSign in
Socket

@s1seven/schema-tools

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@s1seven/schema-tools

This repository contains tools to validate certificate(s), generate TS interfaces from a specified schema and generate HTML string from a certificate.

latest
npmnpm
Version
0.3.3
Version published
Weekly downloads
2
-92.31%
Maintainers
2
Weekly downloads
 
Created
Source

Schema-tools

This repository contains tools to validate certificate(s), generate TS interfaces from a specified schema and generate HTML string from a certificate.

All the modules take as input a certificate path | url | object from which the RefSchemaUrl property will be resolved to fetch dependencies located https://schemas.en10204.io/ such as schema reference, translations, templates ...

Install

npm install @s1seven/schema-tools

Validate

The validate module is using AJV to validate your certificate(s) residing in a specified folder | file | url or by using an JSONSchema or an array of JSONSchema.

Examples

The example wrap the validate module in a function using process.argv.

The first argument is the folder path were resides your certificates to validate.

node ./examples/validate.js ./fixtures/en10168

Generate TS Interfaces

The generate module is using json-schema-to-typescript to generate TS interfaces and types using a JSON / OpenAPI schema.

Examples

The example wrap the generate module in a function using process.argv.

First argument is the schema url to generate from, the second argument is the filepath where interfaces will be saved.

node ./examples/generate-interfaces.js https://schemas.en10204.io/en10168-schemas/v0.0.2-2/schema.json ./certificate.ts

Generate HTML

The generateHtml module is using handlebars and/or mjml to generate HTML string using a JSON schema.

Examples

The example wrap the generateHtml module in a function using process.argv.

First argument is the certificate path to generate from.

node ./examples/generate-html.js ./fixtures/EN10168/valid_en10168_test.json

FAQs

Package last updated on 03 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts