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

co2m.js

v1.0.9

Published

___

Downloads

453

Readme

co2m.js


🚦 Build Status

co2m.js workflow

co2m.js workflow

co2m.js workflow


The Common JS Library


✨Common JavaScript Utilities ✅ is a collection of reusable, well-tested, and easy-to-use utility functions designed to simplify everyday JavaScript programming tasks. This library provides a set of commonly needed functionalities, ranging from array manipulations and object operations to string processing and date handling. Whether you are working on a web application, Node.js project, or any other JavaScript-based project, these utilities can help you write cleaner and more efficient code by reducing the need to reinvent the wheel.

❇️❇️ Key features include:

  1. Array Operations - Functions for sorting, filtering, flattening, and manipulating arrays.
  2. Object Utilities - Tools for deep cloning, merging, and comparing objects.
  3. String Manipulations - Handy methods for formatting, trimming, splitting, and joining strings.
  4. Date Handling - Utilities for parsing, formatting, and calculating date differences.
  5. Type Checking - Functions to determine data types, including custom type checks.
  6. Math Utilities - Methods for performing common mathematical operations like rounding, averaging, and finding the maximum/minimum values.
  7. Random Generation - Utilities for generating secure random numbers, strings, and IDs.
  8. Numeric Manipulations - Functions to handle numerical operations, including conversions, rounding, and precision handling.
  9. Boolean Operations - Tools for simplifying logical expressions and boolean evaluations
  10. Throwable Utilities - Functions to create and manage custom errors, with tools for enhanced error handling and debugging.
  11. Miscellaneous - Other helpful utilities such as debounce, throttle, and random ID generation.

This project is ideal for developers looking for a lightweight, dependency-free library to enhance their JavaScript coding experience. All utilities are optimized for performance and are designed to work seamlessly across different environments, including browsers and Node.js.

🚀 Installation

You can easily install the Common JavaScript Utilities library via npm. Simply run the following command in your project directory:

npm install co2m.js

Alternatively, if you're using Yarn, you can install it with:

yarn add co2m.js

Once installed, you can start using the utility functions in your JavaScript or TypeScript projects by importing the necessary modules:

// Importing specific utilities
import {ArrayUtils, StringUtils} from 'co2m.js';

// Using a utility function
const sortedArray = ArrayUtils.sortInt([5, 2, 9, 1]);
// ==> [1, 2, 5, 9]
const distinctArray = ArrayUtils.distinct<number>([12, 2, 12, 9]);
// ==> [12, 2, 9]
const formattedString = StringUtils.trim('   Hello World!   ');
// ==> 'Hello World!'
const padString = StringUtils.leftPad("1", "0", 3);
// ==> '0001'
License

This project is licensed under the Apache License 2.0.

You are free to use, modify, and distribute this software in accordance with the terms of the license. For more details, please refer to the LICENSE file included in the repository.