0.9.6 • Published 3 years ago

toolsy v0.9.6

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

⚙️ Toolsy

In different projects, we create different tools to make things easier. These tools may be very effective for many projects, so we always have these tools with us in different projects. So we decided to make a great collection of these tools in one package that we call it toolsy.

Features:

  • Different tools in all fields of JavaScript.
  • Documented and tested tools.
  • Low code and maximum performance.
  • Easy to use in various modes.

🌟 STAR to add more features/customizations.

🏁 Start

🌵 Installation

You can install the library with awesome yarn:

yarn add toolsy

or with npm:

npm install toolsy

📟 Usage

You can import the library in the following ways:

import * as toolsy from 'toolsy';
// Import all tools named toolsy.

console.log(toolsy.array.isEmpty([]));

Or:

import { array } from 'toolsy';
// Direct import of required tools.

console.log(array.isEmpty([]));

⛏️ API

Number

NameTypeDescription
isNumber()NumberPass your parameter to isNumber() to check if it is number or not.
isEven()NumberPass your parameter to isEven() to check if it is even or not.
isOdd()NumberPass your parameter to isOdd() to check if it is odd or not.
putCommas()NumberPass your number to putCommas() and deliver it with a comma between each 3-digit piece.
toEnglish()StringPass your Arabic (or similar languages) number to the toEnglish() utility and deliver it with a English digits as integer type.
toArabic()NumberPass your English number to the toArabic() utility and deliver it with a Arabic digits as string type.

Object

NameTypeDescription
isEmpty()ObjectPass your object to isEmpty() to check if it is empty or not.
toArray()ObjectPass your object to toArray() to convert all values as a array index.

Array

NameTypeDescription
isEmpty()ArrayPass your array to isEmpty() to check if it is empty or not.
sort()ArrayPass your array to sort() to arrange your array.
sortByProp()Array, StringPass your array to sortByProp() to sort by alphabet for strings and sort by number for numbers.

Number

isNumber()

isNumber(2)
  // true

isEven()

isEven(2)
  // true

isOdd()

isOdd(2)
  // false

putComma()

putCommas(123)
  // 123
   
putCommas (1234)
  // 1,234
   
putCommas (1234567)
  // 1,234,567

toEnglish()

toEnglish("۱۲۳۴")
  // 1234

toArabic()

toArabic(12345)
  // "۱۲۳۴۵"

Object

isEmpty()

isEmpty({})
  // true
   
isEmpty({ name: 'toolsy' })
  // false

toArray()

toArray({ name: 'toolsy', language: 'javaScript' })
  // ['toolsy', 'javaScript']

Array

isEmpty()

isEmpty([])
  // true

sort()

sort([1,66, 12, 20])
  // [1, 12, 20, 66]

sortByProp()

sortByProp([ { name: 'Sarah', age: 19 }, { name: 'Alex', age: 12 } ], "age")
  // [ { name: 'Alex', age: 12 }, { name: 'Sarah', age: 19 } ]

⚖️ License

The library is released under the MIT license. Copyright © 2020 Mohammad Goldast.

See LICENSE for more information.

0.9.6

3 years ago

0.9.5

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.14

3 years ago

0.8.13

3 years ago

0.8.12

3 years ago

0.8.11

3 years ago

0.8.10

3 years ago

0.8.9

3 years ago

0.8.8

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.0.1

4 years ago