Gathering detailed insights and metrics for ngx-order-pipe
Gathering detailed insights and metrics for ngx-order-pipe
Gathering detailed insights and metrics for ngx-order-pipe
Gathering detailed insights and metrics for ngx-order-pipe
npm install ngx-order-pipe
Typescript
Module System
Node Version
NPM Version
95.9
Supply Chain
100
Quality
76.1
Maintenance
100
Vulnerability
100
License
TypeScript (77.78%)
HTML (14.78%)
JavaScript (4.83%)
SCSS (2.61%)
Total Downloads
7,455,420
Last Day
523
Last Week
19,455
Last Month
85,746
Last Year
1,022,070
MIT License
239 Stars
334 Commits
57 Forks
10 Watchers
4 Branches
10 Contributors
Updated on Feb 04, 2025
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
ngx-order-pipe@3.0.0
Unpacked Size
51.64 kB
Size
12.46 kB
File Count
13
NPM Version
9.7.2
Node Version
20.4.0
Published on
May 18, 2024
Cumulative downloads
Total Downloads
Last Day
9%
523
Compared to previous day
Last Week
-7.3%
19,455
Compared to previous week
Last Month
-1.5%
85,746
Compared to previous month
Last Year
-4.3%
1,022,070
Compared to previous year
1
Order your collection by a field
https://vadimdez.github.io/ngx-order-pipe/
or see code example
https://stackblitz.com/edit/ngx-order-pipe
npm install ngx-order-pipe --save
For Angular lower than 5 use version 1.1.3
In case you're using systemjs
- see configuration here. Otherwise skip this part.
1{{ collection | orderBy: expression : reverse : caseInsensitive : comparator }}
Param | Type | Default Value | Details |
---|---|---|---|
collection | array or object | The collection or object to sort | |
expression | string or string array | The key or collection of keys to determinate order | |
reverse (optional) | boolean | false | Reverse sorting order |
caseInsensitive (optional) | boolean | false | Case insensitive compare for sorting |
comparator (optional) | Function | Custom comparator function to determine order of value pairs. Example: (a, b) => { return a > b ? 1 : -1; } See how to use comparator |
Import OrderModule
to your module
1import { NgModule } from '@angular/core'; 2import { BrowserModule } from '@angular/platform-browser'; 3import { AppComponent } from './app'; 4 5import { OrderModule } from 'ngx-order-pipe'; 6 7@NgModule({ 8 imports: [BrowserModule, OrderModule], 9 declarations: [AppComponent], 10 bootstrap: [AppComponent] 11}) 12export class AppModule {} 13
And use pipe in your component
1import { Component } from '@angular/core'; 2 3@Component({ 4 selector: 'example', 5 template: ` 6 <ul> 7 <li *ngFor="let item of array | orderBy: order"> 8 {{ item.name }} 9 </li> 10 </ul> 11 ` 12}) 13 14export class AppComponent { 15 array: any[] = [{ name: 'John'} , { name: 'Mary' }, { name: 'Adam' }]; 16 order: string = 'name'; 17}
Use dot separated path for deep properties when passing object.
1<div>{{ { prop: { list: [3, 2, 1] } } | orderBy: 'prop.list' | json }}</div>
Result:
1<div>{ prop: { list: [1, 2, 3] } }</div>
Import OrderPipe
to your component:
1import { OrderPipe } from 'ngx-order-pipe';
Add OrderPipe
to the constructor of your component and you're ready to use it:
1constructor(private orderPipe: OrderPipe) { 2 console.log(this.orderPipe.transform(this.array, this.order)); // both this.array and this.order are from above example AppComponent 3}
Case insensitive flag is the third parameter passed to the pipe. Can be true
to make comparison case insensitive and false
to make comparison case sensitive.
By default value is set to false.
true
)1<li *ngFor="let item of array | orderBy: order : false : true"> 2 {{ item.name }} 3</li>
false
will do case sensitive comparison to order collection:1<li *ngFor="let item of array | orderBy: order : false : false"> 2 {{ item.name }} 3</li>
If this project help you reduce time to develop, you can give me a cup of tea :)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
Found 1/6 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
31 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More