# jijejo-node

> javascript implementation of jijejo specifications https://github.com/AlbanMinassian/jijejo-spec

Latest version **1.0.8** (published 2021-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install jijejo-node
pnpm add jijejo-node
yarn add jijejo-node
bun add jijejo-node
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-05-25 |
| First published | 2020-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=14.15.1 |
| Dependencies | 0 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alban Minassian |
| Maintainers | ami44 |
| Keywords | jijejo, utils |

## Links

- npm: https://www.npmjs.com/package/jijejo-node
- Repository: https://github.com/AlbanMinassian/jijejo-node
- Homepage: https://github.com/AlbanMinassian/jijejo-node#readme
- Issues: https://github.com/AlbanMinassian/jijejo-node/issues
- npm.io page: https://npm.io/package/jijejo-node

## Recent versions

- 1.0.8 (latest) — 2021-05-25
- 1.0.7 — 2021-05-13
- 1.0.6 — 2021-05-13
- 1.0.5 — 2021-04-28
- 1.0.4 — 2021-04-28
- 1.0.3 — 2021-04-28
- 1.0.2 — 2020-07-23
- 1.0.1 — 2020-06-10
- 1.0.0 — 2020-06-10

## README

# README

[![Build Status](https://travis-ci.com/AlbanMinassian/jijejo-node.svg?branch=master)](https://travis-ci.com/AlbanMinassian/jijejo-node)
<!--[![Coverage Status](https://coveralls.io/repos/github/AlbanMinassian/jijejo-node/badge.svg?branch=master)](https://coveralls.io/github/AlbanMinassian/jijejo-node?branch=master)-->
[![codecov](https://codecov.io/gh/AlbanMinassian/jijejo-node/branch/master/graph/badge.svg?token=421AOGKHC3)](https://codecov.io/gh/AlbanMinassian/jijejo-node)

[jijejo-node](https://github.com/AlbanMinassian/jijejo-node) is a collection of functions to create and validate json compliant with [jijejo-spec/functions.md](https://github.com/AlbanMinassian/jijejo-spec/blob/master/functions.md) specifications.

Jijejo is a universal and easy api for all yours applications or libraries. Jijejo is a human and light alternative of [json:api](https://jsonapi.org/), [json-ld](https://json-ld.org/), [hal](http://stateless.co/hal_specification.html), [OpenAPI](https://swagger.io/specification/), [GraphQL](https://graphql.org/), [joi](https://github.com/hapijs/joi), [zod](https://github.com/vriad/zod), [yup](https://github.com/jquense/yup), [hydra](http://www.markus-lanthaler.com/hydra/) ... Back to basics to get ahead in your business. Read more by visiting [jijejo-spec](https://github.com/AlbanMinassian/jijejo-spec).

jijejo = (**j**)son (**i**)n + (**j**)son (**e**)rr + (**j**)son (**o**)ut

[![jijejo-spec](https://raw.githubusercontent.com/AlbanMinassian/jijejo-spec/HEAD/assets/svg/draft.png)](https://github.com/AlbanMinassian/jijejo-spec)

## install

```bash
npm install jijejo-node
```

## usage

```js
import { jsonin, jsonerr, jsonout, jicheck, jecheck, jocheck } from 'jijejo-node';
```

<!-- SECTIONABOUT/START -->
## functions

### creates

#### jsonin

function to create jsonin.

```js
jsonin({"hello": "in"}) // return { meta:{}, in: {"hello": "in"}}
jsonin({"hello": "in"}, {"hello": "meta"}) // return { meta:{"hello": "meta"}, in: {"hello": "in"}}
```

#### jsonerr

function to create jsonerr.

```js
jsonerr({"hello": "err"}) // return { meta:{}, iserr: true, isout: false, err: {"hello": "err"}}
jsonerr({"hello": "err"}, {"hello": "meta"}) // return { meta:{"hello": "meta"}, iserr: true, isout: false, out: {"hello": "err"}}
```

#### jsonout

function to create jsonout.

```js
jsonout({"hello": "out"}) // return { meta:{}, iserr: false, isout: true, out: {"hello": "out"}}
jsonout({"hello": "out"}, {"hello": "meta"}) // return { meta:{"hello": "meta"}, iserr: false, isout: true, out: {"hello": "out"}}
```

### checks

#### jicheck = (j)son (i)n (check)

This function must verify jsonin basic attributs.

```js
jicheck({}); // return error because missing attribut in
jicheck({ in: {} }); // return ok, jsonin is valid
```

#### jecheck = (j)son (e)rr (check)

This function must verify jsonerr basic attributs.

```js
jecheck({ isout: true, iserr: true, err: {} }); // return error because isout==true
jecheck({ isout: false, iserr: true, err: {} }); // return ok, jsonerr is valid
```

#### jocheck = (j)son (o)ut (check)

This function must verify jsonout basic attributs.

```js
jocheck({ isout: true, iserr: true, out: {} }); // return error because iserr==true
jocheck({ isout: true, iserr: false, out: {} }); // return ok, jsonout is valid
```

<!-- SECTIONABOUT/END -->

<!-- SECTIONDEVEL/START -->
## development

- `git clone https://github.com/AlbanMinassian/jijejo-node`
- `cd jijejo-node`
- `npm install`
- `npm run test`
- `npm run coverage`
<!-- SECTIONDEVEL/END -->

## license

MIT

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