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

ngx-array

v3.0.10

Published

Array class is a global object that is used in the construction of arrays; which are high-level, list-like objects.

Downloads

50

Readme

Welcome to ngx-array!

ngx-array npm version ngx-array

Array class is a global object that is used in the construction of arrays; which are high-level, list-like objects.

Features: Handled exceptions which generally occurs while developing a array based functionalities



Import

Import the module on your app.module.ts file as follow.

import { NgxArrayModule} from "ngx-array";

Then import the module as follow on imports array

NgxArrayModule

Using

After importing this library with npm install ngx-array, go to the component which is declared under app.module.ts and integrate as below.

NGX LOGS MODULE

constructor(private _ngArray: NgxArrayService) { }

Use reference for NgxArrayService in constructor and import it respectively at any component

Methods

This are the methods available with ngx-array use it as per your requirement:

  • _min(arr: Array<any>); - Returns the minimum value in the array. arr: Array of values of any type[].

  • _max(arr: Array<any>); - Returns the maximum value in the array arr: Array of values of any type[].

  • _sortNumbers(arr: Array<any>, mode: number = 1);

  • Method sorts the elements of an numbers array in place and returns the sorted array. arr: Array of values of any type[].
    mode: 1 for ascending , -1 for descending - Default 1 - optional

  • _sort(arr: Array<any>) - Method sorts the elements of an array in place and returns the sorted array. arr: Array of values of any type[].

  • _reverse(arr: Array<any>) - Returns the reverse ordered array. arr: Array of values of any type[].

  • _join(arr: Array<any>, joinBy: string = "") - New string by concatenating all of the elements in an array. arr: Array of values of any type[].
    joinBy: Concatenate by the string example = (-).

  • _indexOfFrom(arr: Array<any>, item: any, start: number) - Returns the index of item from given array from starting at particular index. arr: Array of values of any type[].
    item: Searchable item in array of any type start: Starting index

  • _indexOf(arr: Array<any>, item: any) - Returns the index of item from given array. arr: Array of values of any type[].
    item: Searchable item in array of any type

  • _hasAt(arr: Array<any>, item: any, positionIndex: number) - Checks whether the array contains the item at particular given index. arr: Array of values of any type[].
    item: Searchable item in array of any type positionIndex: Starting index

  • _has(arr: Array<any>, item: any) - Checks whether the array contains the item. arr: Array of values of any type[].
    item: Searchable item in array of any type

  • _filterNumbersArray(arr: Array<number>, condition, expected: number) - Filters integer array for an given condition. arr: Array of values of any type[].
    condition: Possible conditions ('>' , '<' , '>=', '<=' , '!==') expected: Resulted value should be in

  • _fill( arr: Array<any>, value: any, from: number, to: number ) - method shallow copies part of an array to another location in the same array and returns it. arr: Array of values of any type[].
    value: value to be filled in array from: Start from this position to: End at this position

  • _copyWithin(arr: Array<any>, from: number, to: number) - Method shallow copies part of an array to another location in the same array and returns it. arr: Array of values of any type[].
    from: Start from this position to: End at this position

  • _concat(...args: Array<any>) - Method is used to merge two or more arrays. args: Multiple Array of values at any length

  • _length(arr: Array<any>) - Returns the length of the given array args: Multiple Array of values at any length

  • _copy(arr: Array<any>) - Duplicates an array arr: Array of values of any type[].

  • _slice( arr: Array<any>, start: number, end: number = arr.length - 1 ) - returns a shallow copy of a portion of an array into a new array object selected from start to end. arr: Array of values of any type[].
    start: Start from this position end: End at this position

  • _splice( arr: Array<any>, start: number, end: number = arr.length - 1 ) - Cut of / Splice of an items at particular valid index arr: Array of values of any type[].
    start: Start from this position end: End at this position

  • _shift(arr: Array<any>) - Method remove first element at the beginning of an array and returns the new length of the array. arr: Array of values of any type[].

  • _unshift(arr: Array<any>) - Method adds one or more elements to the beginning of an array and returns the new length of the array. arr: Array of values of any type[].

  • _pop(arr: Array<any>) - It will remove the array item at end & return item arr: Array of values of any type[].

  • _push(arr: Array<any>, item: any) - It will add / push new item to the array at end & return new array arr: Array of values of any type[]. item: item to be pushed of any type

Code integration

To use this package as a service npm i ngx-array install this on the root angular project .

Note: Don't forget to run this commend npm i ngx-array on root folder or else it will throw error.