1.0.0 • Published 4 years ago

nbk.js v1.0.0

Weekly downloads
2
License
BSD-3-Clause
Repository
github
Last release
4 years ago

nbk

A simple js library

This library is just to save time in normally recurrent tasks like numbers comparisons and so on.

installation

As a npm dependency

To install as a project dependency, just run one of the following commands from your terminal.

With npm

$ npm install --save nbk.js
$ npm install --save-dev nbk.js

With yarn

$ yarn add nbk.js
$ yarn add nbk.js --dev

For browser usage

To add to your browser based project, you have the following options:

CDN

Take just one of those tags

<script src="https://cdn.jsdelivr.net/gh/kenliten/nbk/dist/nbk.js"></script>
<script src="https://cdn.jsdelivr.net/gh/kenliten/nbk/dist/nbk.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/kenliten/nbk/dist/nbk.module.js"></script>
<script src="https://cdn.jsdelivr.net/gh/kenliten/nbk/dist/nbk.module.min.js"></script>

Local copy

Download the library from the releases and copy it to your work directory.

Usage

nbk.module.method(params);

For example, to get the total sum of the values in an array, do this:

// node.js project
const nbk = require('nbk');

// using module in browser
import nbk from 'nbk';

let numbers = [32, 87, 967, 12, 54];
let sum = nbk.math.add(numbers); //1152

info

The library is built on sub modules, currently there is only one:

nbk.math

In this module you'll find these methods:

  • add (Add numbers, just two or all inside an array)
  • sub (Substract numbers, like add)
  • great (Compares two or more numbers and returns the greater)
  • less (Compares right the opposite way great does)
  • odd (Validate if a number is odd)
  • even (Validate if a number is even)
  • opos (Returns the apposite number)
  • pit (Calculate hypotenuse from the value of two hicks)

All of them will be explained in detail in the upcomming documentation