Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eik/common

Package Overview
Dependencies
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eik/common

Common utilities for Eik modules

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3K
decreased by-9%
Maintainers
4
Weekly downloads
 
Created
Source

Eik Commons

This package contains common utilities and schemas

APIs

schemas

eik.json

Importing schemas

const { schemas, assert } = 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: [],
});

//or 

assert.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');

// or

assert.name('my-app');
version
const { error, value } = schemas.validate.version('1.0.0');

// or

assert.version('1.0.0');
server
const { error, value } = schemas.validate.server('http://myeikserver.com');

// or

assert.server('http://myeikserver.com');
files
const { error, value } = schemas.validate.files({
    './index.js': '/path/to/file.js'
});

// or

assert.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',
]);

// or

assert.importMap([
    'http://meserver.com/map1.json',
    'http://meserver.com/map2.json',
]);
out
const { error, value } = schemas.validate.out('./.eik');

// or

assert.out('./.eik');

FAQs

Package last updated on 10 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc