0.0.1 • Published 3 years ago

mew-object v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

mew-object

The validation library to validate shared object between telemetry and mew-cli

Installation

$ npm install mew-object

# or yarn
$ yarn add mew-object

Usage

const sharedObject = require('mew-object');

const defaultObj = {
  model_name: 'name',
  model_class: 'class',
  model_group: 'group',
  description: 'description',
  language: 'language',
};

const result = sharedObject().validate(defaultObj);

Contributing

Prerequisites

To contribute this repo, you'll need:

Currently, I was verified with Node v12.15.0, npm v6.13.4, and joi v17.3.0

Getting started

Once you clone the repo run the following commands to get started:

$ npm i
$ npm run build

# or yarn
$ yarn
$ yarn run build

Commands available

  • npm run build - Builds the code and creates file for distribution
  • npm run test - Runs tests
  • npm run lint - Runs eslint on the whole codebase
  • npm run format - Runs prettier on the whole codebase
  • npm version patch - Let's bump a new patch version of the package
  • npm publish - Publish a new version of the package

Publishing package

You should create a personal access token (PAT) to use in place of a password

In the creating (PAT) above make sure that you have enabled permissions repo, write:packages, and you should enable SSO enabled for the token after the token is create

The steps to publish package to Github Package repo:

(1) Let's bump a new patch version of the package:

$ npm version patch

(2) Publish package from the command line:

$ npm publish

Once succeed! We have a new version of the package.

Libraries

  • joi - The most powerful data validation library for JS