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

amigo-js

v2.1.5

Published

Amigo JS offers developers a powerful and easy-to-use toolset. With its clean, modular and scalable code structure, it accelerates development processes and reduces code complexity. With a wide range of functions, it offers ready-made methods for solving

Downloads

10

Readme

Amigo JS

Amigo JS offers developers a powerful and easy-to-use toolset. With its clean, modular and scalable code structure, it accelerates development processes and reduces code complexity. With a wide range of functions, it offers ready-made methods for solving common problems.

NPM
npm install amigo-js
YARN
yarn add amigo-js

Awesome Utils

deepClone

Clone data from any data (disconnect any data binding)

Function Signature
deepClone(val: any): typeof val
Examples
const clonedVal = deepClone({ name: "test" });
expect(clonedVal).not.toBe({ name: "test" }); // reference equal
expect(clonedVal).toEqual(clonedVal); // soft equal

Compare

isDeepEqual

Checks the equality of two values.

Function Signature
isDeepEqual(valOne: any, valTwo: any): boolean
Examples
isDeepEqual(10, 10); // true

isDeepEqual("test", 1); // false

isDeepEqual(null, 1); // false

isDeepEqual(null, NaN); // false

isDeepEqual(NaN, NaN); // false

isDeepEqual({ name: "john" }, { name: "john" }); // true

isDeepEqual(["john"], ["john"]); // true

isDeepEqual([{ key: "value" }], [{ key: "value" }]); // true

Type Check

isObject

Check if val is an object

Function Signature
isObject(val: any): boolean
Examples
isObject([]); // true
isObject(null); // false
isObject(undefined); // false
isObject(NaN); // false
isObject({}); //
isObject(new Date()); // true

isDate

Check if val is an date

Function Signature
isDate(val: any): boolean
Examples
isDate(Date); // false
isDate(null); // false
isDate("12-22-2023"); // false
isDate(new Date()); // true

isBoolean

Check if val is true or false (boolean)

Function Signature
isBoolean(val: any): boolean
Examples
isBoolean(null); // false
isBoolean(false); // true
isBoolean(true); // true
isBoolean(Boolean); // false
isBoolean(0); // false

isArray

Check if val is an array

Function Signature
isArray(val: any): boolean
Examples
isArray(null); // false
isArray({}); // false
isArray([]); // true
isArray(new Array([])); // true

isNumber

Check if val is an number

Function Signature
isNumber(val: any): boolean
Examples
isNumber(null); // false
isNumber(NaN); // true
isNumber(1); // true
isNumber("1"); // false

isFunction

Check if val is an function

Function Signature
isFunction(val: any): boolean
Examples
isFunction(NaN); // false
isFunction(() => {}); // true

Test Coverage Result

| File | % Stmts | % Branch | % Funcs | % Lines | | ---------------- | ------- | -------- | ------- | ------- | | All files | 95.23 | 91.66 | 100 | 100 | | lib | 0 | 0 | 0 | 0 | | index.ts | 0 | 0 | 0 | 0 | | lib/enums | 0 | 0 | 0 | 0 | | NodeEnum.ts | 0 | 0 | 0 | 0 | | lib/helpers | 100 | 75 | 100 | 100 | | node.helper.ts | 100 | 75 | 100 | 100 | | lib/modules | 94.91 | 92.64 | 100 | 100 | | deep-clone.ts | 100 | 90 | 100 | 100 | | is-array.ts | 100 | 100 | 100 | 100 | | is-boolean.ts | 100 | 100 | 100 | 100 | | is-date.ts | 100 | 100 | 100 | 100 | | is-deep-equal.ts | 90.62 | 90.69 | 100 | 100 | | is-function.ts | 100 | 100 | 100 | 100 | | is-number.ts | 100 | 100 | 100 | 100 | | is-object.ts | 100 | 100 | 100 | 100 |

created by Ahmet ilhan