Eik Commons
This package contains common utilities and schemas
APIs
schemas
eik.json
Importing schemas
const { schemas } = require('@eik/common');
Validating an eik.json
file
const { error, value } = schemas.validate.eikJSON({
name: 'my-app',
version: '1.0.0',
server: 'http://eik-server',
files: [],
});
Using invididual schema validators
name
const { error, value } = schemas.validate.name('my-app');
version
const { error, value } = schemas.validate.version('1.0.0');
server
const { error, value } = schemas.validate.server('http://myeikserver.com');
files
const { error, value } = schemas.validate.files({
'./index.js': '/path/to/file.js'
});
import map
const { error, value } = schemas.validate.importMap('http://meserver.com/map.json');
const { error, value } = schemas.validate.importMap([
'http://meserver.com/map1.json',
'http://meserver.com/map2.json',
]);
out
const { error, value } = schemas.validate.out('./.eik');