schema-component

0.0.6 • Public • Published

Schema

Language-agnostic schema package manager for better data models, built with component.

Features

  • write reusable JSON schemas to define data models
  • no registry publishing or account required, uses github repositories
  • automatic versioning using git commit ids.

Installation

With node.js previously installed:

npm install -g schema-component

Usage

To generate a new schema project:

$ schema create user

  create : user
  create : user/Readme.md
  create : user/component.json
  create : user/.gitignore
  create : user/index.json

$

To install any schema:

component install <org/repo>

To build a ./build/schema.json file from components:

schema build

To build it as a standalone javascript file:

schema build -s

To use use in the component build process:

var schema = require('schema-component');
var Builder = require('component-builder');

var builder = new Builder;
builder.use(schema);
builder.build(function(err, out){
  console.log(out.schema);
});

Notes

Reserved properties

  • name
  • type
  • description
  • title
  • image
  • url
  • value

The value associated with the value key must be either a string, a number, true, false or null.

The value associated with the type key must be a term, a compact IRI, an absolute IRI, a relative IRI, or null.

Todo

schema validate ./data.json --against ./schema.json

Maybe should work similar to brew tap x, so you can bundle schemas into single repos.

Licence

  • MIT
  • Surveying icon by Luis Prado from The Noun Project

Readme

Keywords

none

Package Sidebar

Install

npm i schema-component

Weekly Downloads

0

Version

0.0.6

License

none

Last publish

Collaborators

  • viatropos