1.0.8 • Published 1 year ago

js-toolkit-apollo156 v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Utility Toolkit

Utility Toolkit is a JavaScript package providing a collection of utility functions for common tasks.

Installation

You can install the Utility Toolkit package via npm:

npm install --save js-toolkit-apollo156

Usage

const UtilityToolkit = require('utility-toolkit');

// Capitalize the first letter of a string
console.log(UtilityToolkit.capitalizeFirstLetter('hello')); // Output: Hello

// Check if a number is even
console.log(UtilityToolkit.isEven(4)); // Output: true

// Check if a number is odd
console.log(UtilityToolkit.isOdd(5)); // Output: true

// Generate a random integer between 1 and 10
console.log(UtilityToolkit.randomInt(1, 10)); // Output: (random number between 1 and 10)

// Shuffle an array
const array = [1, 2, 3, 4, 5];
console.log(UtilityToolkit.shuffleArray(array)); // Output: (shuffled array)

Functions

  • capitalizeFirstLetter(str): Capitalizes the first letter of a string.
  • isEven(num): Checks if a number is even.
  • isOdd(num): Checks if a number is odd.
  • randomInt(min, max): Generates a random integer between min and max (inclusive).
  • shuffleArray(array): Shuffles the elements of an array.

License

This package is licensed under the MIT License. See the LICENSE file for details.

1.0.8

1 year ago

1.0.7

1 year ago

1.0.5

1 year ago

1.0.2

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago