npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

skeeler-json-schema-draft-6

v0.0.0

Published

JSON Schema Draft 6 plugin for Skeeler

Downloads

16

Readme

skeeler-json-schema-draft-6

Build Status Coverage Status

[WIP] JSON Schema Draft 6 plugin for Skeeler

Table of Contents

Simple Example

import Skeeler from 'skeeler';
import SkeelerJSONSchemaDraftV6 from 'skeeler-json-schema-draft-6';

const types = Skeeler.use('json', new SkeelerJSONSchemaDraftV6()).getTypes();

const mySkeeler = new Skeeler({
  foo: types.string.required,
  bar: types.number.exclusiveMinimum(0),
  baz: types.anyOf([
    types.object({
      qux: types.number,
      quux: types.boolean,
    }),
    types.enum(['corge', 'grault']),
    types.array(types.string),
  ]).required,
});

export default mySkeeler.export('json');
Equals to JSON Schema Draft 6
export default {
  type: 'object',
  properties: {
    foo: {
      type: 'string',
    },
    bar: {
      type: 'number',
      exclusiveMinimum: 0,
    },
    baz: {
      anyOf: [
        {
          type: 'object',
          properties: {
            qux: {
              type: 'number',
            },
            quux: {
              type: 'boolean',
            },
          },
        },
        {
          enum: ['corge', 'grault'],
        },
        {
          type: 'array',
          items: {
            type: 'string',
          },
        },
      ],
    },
  },
  required: ['foo', 'baz'],
};

Options

By default, all the schema definitions will be compiled to properties in JSON schema, and the root type is object.

rootProps option

If you want to pass some attributes outside properties, you may use rootProps option.

Example
const skeeler = new Skeeler({});
const options = { rootProps: { title: 'awesome' } };
skeeler.export('json', options);

/**
 * output
 *
 * { type: 'object', properties: {}, title: 'awesome' }
 */

strict option

If you want to writing in native JSON Schema way, you may use strict option.

Example
const skeeler = new Skeeler({
  properties: {
    foo: types.string,
    bar: types.number,
  },
  required: ['foo', 'bar'],
});
const options = { strict: true };
skeeler.export('json', options);

/**
 * output
 *
 * {
 *  properties: {
 *    foo: { type: 'string' },
 *    bar: { type: 'number' },
 *  },
 *  required: ['foo', 'bar'],
 * }
 */
Or
const skeeler = new Skeeler(
  types
    .properties({
      foo: types.string,
      bar: types.number,
    })
    .required(['foo', 'bar']),
);
const options = { strict: true };
skeeler.export('json', options);

Keywords

Please checkout keywords.js

This plugin is friendly to ajv and supports all ajv keywords

Syntactic Sugars

array()

types.array(types.string)

equals to

types.array.items(types.string)

object()

types.object({ foo: types.string })

equals to

types.object.properties({ foo: types.string })

required

{ foo: types.required, bar: types.required }

will be compiled to

{ properties: { foo: {}, bar: {} }, required: ['foo', 'bar'] }

NOTE: Only work when strict option is NOT true

dependencies

{ foo: types.dependencies(['bar']) }

will be compiled to

{ properties: { foo: {} }, dependencies: { foo: ['bar'] } }

NOTE: Only work when strict option is NOT true

func

types.func

equals to

types.instanceof('Function')

NOTE: instanceof is a custom keyword for ajv

Related projects

License

MIT