0.0.1 • Published 3 years ago
mew-object v0.0.1
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:
- A local development environment for Node.js. Follow How to Install Node.js and Create a Local Development Environment.
- Joi v17 or higher
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 distributionnpm run test
- Runs testsnpm run lint
- Runseslint
on the whole codebasenpm run format
- Runsprettier
on the whole codebasenpm version patch
- Let's bump a new patch version of the packagenpm 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
0.0.1
3 years ago