npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

toolsy

v0.9.6

Published

A great collection of tools used by JavaScript for programmers.

Downloads

40

Readme

⚙️ 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

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

Object

| Name | Type | Description | | ------------ | ------------ | ------------ | | isEmpty() | Object | Pass your object to isEmpty() to check if it is empty or not. | | toArray() | Object | Pass your object to toArray() to convert all values as a array index. |

Array

| Name | Type | Description | | ------------ | ------------ | ------------ | | isEmpty() | Array | Pass your array to isEmpty() to check if it is empty or not. | | sort() | Array | Pass your array to sort() to arrange your array. | | sortByProp() | Array, String | Pass 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.