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-lodash-pipes-ivy

v0.0.14

Published

This collection of pipes can help you simplify your [lodash](https://lodash.com/) calls for data binding. And they are naturally chainable through multiple pipes.

Downloads

57

Readme

Angular Lodash Pipes

This collection of pipes can help you simplify your lodash calls for data binding. And they are naturally chainable through multiple pipes.

There are two forms of pipes provided: umbrella-form and direct-form.

The umbrella-form pipe (_) covers all available functions of lodash. When using the umbrella-form pipe (_), an arbitrary function name should be provided as the first argument. You may use the _ pipe with caution that you should check the function name existence in lodash.

A direct-form pipe, such as chunk, compact, ..., has exactly the same lodash method name. At present, the number of pipes in this form is limited, and it is planned to gradually implement all the methods of lodash.

Available pipes are listed here.

Usage

1.Install lodash and ngx-lodash-pipes.

npm i -S lodash ngx-lodash-pipes

2.Import NgxLodashPipesModule to your Angular module.

Angular 4

import { NgxLodashPipesModule } from 'ngx-lodash-pipes/src';
@NgModule({
  imports: [
    ...
    NgxLodashPipesModule,
    ...
  ],
  ...

Angular 5+

import { NgxLodashPipesModule } from 'ngx-lodash-pipes';
@NgModule({
  imports: [
    ...
    NgxLodashPipesModule,
    ...
  ],
  ...

A module that only exports and declares the umbrella-form pipe (_), NgxLodashPipeModule is also available in this library. This module takes dramatically small footprint.

3.Use lodash pipes in your angular component template.

interpolation:

Umbrella-form: {{ [ 'a', 'b', 'c', 'd' ]  | _: 'chunk' : 2}}

Direct-form: {{ [ 'a', 'b', 'c', 'd' ]  | chunk: 2}}

and more you want to do than interpolation:

<div *ngFor="let pair of [ 'a', 'b', 'c', 'd' ] | chunk: 2 as pairs">
  <!-- Do something with the looping variable, pair -->
  <!-- and even with the list, pairs -->
</div>

4.How to contribute?

Contributions are welcome.

The ngx-lodash-pipes package is a normal Angular library in the projects/ngx-lodash-pipes folder.

There's an LodashPipesSampleComponent in the packages project. This component is used for examples, documentation, and testing purposes. All the pipe arguments are from the examples of lodash official documentation.

Please fork this repository and add your pipes in the ngx-lodash-pipes package. Add your samples of the new-added pipes in the LodashPipesSampleComponent following the existing examples. The example arguments from lodash official documentation are recommended.

Then you can send your pull request. For those just getting started, Github has a howto.

Thanks.

5.Version History

  • 0.0.8 Date and Function pipes finished
  • 0.0.8 Collection pipes finished
  • 0.0.7 Array pipes finished
  • 0.0.6 add some new pipes
  • 0.0.5 ExpressionChangedAfterItHasBeenCheckedError of _: 'pull' etc. handled, add some new pipes
  • 0.0.4 Angular 8 compiler, umdModuleIds for lodash, add some new pipes
  • 0.0.3 ExpressionChangedAfterItHasBeenCheckedError of _: 'fill' handled, add some new pipes
  • 0.0.2 remove the umbrella-form pipe (_) from the module exports and add an NgxLodashPipeModule to export, add some new pipes
  • 0.0.1 initial version exports the umbrella-form pipe (_) and NgxLodashPipesModule with some

Good luck.