open-index/open-npm huggingface dataset:
npm package: @json-spec/core
Description: JSON Spec is a tool for validation and generation of JSON data.
Latest version: 0.1.12

# JSON Spec (Core)

JSON Spec is a tool for validation and generation of JSON data.

## Describe specifications

### Simple spec

If you give the test function to the spec function, the simple spec is created.

```js
s.spec(x => x === 'spec');
```

And you can also give the regexp or an Array.

```js
s.spec(/^\d+/);
s.spec(['a', 'b', 'c']);
```

### Compose specifications

You can compose multiple specs.

`and`

```js
s.and(x => !isNaN(Number(x)), x => x > 1000)
```

`or`

```js
s.or(x => !isNaN(Number(x)), x => typeof(x) === 'string')
```

## Validation

Using `conform` function can check wheather the given value conform the specification.

```js
s.conform(x => );
```
## Explain

An `explain` function outputs detail of specification violations.

```js
s.explain(spec(x => typeof(x) === 'string'), 123);
```
npm package: @json-spec/openapi
Description: JSON Spec Open API
Latest version: 0.1.12

# JSON Spec Open API

JSON Spec Open API

## Usage

```
npm install @json-spec/openapi --save-developers
```

example for Mock server

```
json-spec-server --openapi=[openapi-specification] --jsonspec=[jsonspec-file] --port=[listen-port]
```

example for Mock client

```
json-spec-client --openapi=[openapi-specification] --jsonspec=[jsonspec-file] --base-url=[base-url]
```