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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@nudgeit/nit-pipes

v0.9.7

Published

TypeScript library containing a set of useful pipes. See README for mode details

Downloads

42

Readme

nit-pipes

npm version Build Status MIT licensed

This is a collection of useful pipes for AngularIO (v>=4) with no external dependencies.

Table of contents

Installation

  1. Use npm to install the package
$ npm install @nudgeit/nit-pipes --save
  1. Add into your module imports the NitPipesModule in order to add all of the pipes.
import {NitPipesModule} from ' @nudgeit/nit-pipes';

@NgModule({
 // ...
 imports: [
   // ...
   NitPipesModule
 ]
})

Pipes

first

Returns the first n elements of the array. Any negative value of n is treated as 0 and an empty array will be returned.

Usage: array | first: n

<p>{{ [1, 2, 3, 4] | first: 2 }}</p> <!-- Output: "1, 2" -->

last

Returns the last n elements of the array. Any negative value of n is treated as 0 and an empty array will be returned.

Usage: array | last: n

<p>{{ [1, 2, 3, 4] | last: 2 }}</p> <!-- Output: "3, 4" -->

join

Joins the elements of an array.

Usage: array | join: [separator|optional]

<p>{{ [1, 2] | join: ', ' }}</p> <!-- Output: "1, 2" -->

impureJoin

The impure version of join.

isArray

Tests if a value is an array and returns true if it is or false otherwise.

Usage: value | isArray

<p>{{ [1, 2] | isArray }}</p> <!-- Output: "true" -->
<p>{{ "12" | isArray }}</p> <!-- Output: "false" -->

isBoolean

Tests if a value is a boolean and returns true if it is or false otherwise.

Usage: value | isBoolean

<p>{{ false | isBoolean }}</p> <!-- Output: "true" -->
<p>{{ "12" | isBoolean }}</p> <!-- Output: "false" -->

isDate

Tests if a value is a date and returns true if it is or false otherwise.

Usage: value | isDate

isFunction

Tests if a value is a function and returns true if it is or false otherwise.

Usage: value | isFunction

isNull

Tests if a value is null or undefined and returns true if it is or false otherwise.

Usage: value | isNull

<p>{{ null | isNull }}</p> <!-- Output: "true" -->
<p>{{ undefined | isNull }}</p> <!-- Output: "true" -->
<p>{{ "12" | isNull }}</p> <!-- Output: "false" -->
<p>{{ "" | isNull }}</p> <!-- Output: "false" -->

isString

Tests if a value is a string and returns true if it is or false otherwise.

Usage: value | isString

~safeUrl~

Deprecated - better use safe!

Returns the safe version of an URL. Use this with care!

Usage: url | safeUrl

initials

Returns the initials of the words in a string.

Usage: string | join: [maxLength|optional, default:3]

<p>{{ "Nibo AI" | initials }}</p> <!-- Output: "NA" -->

safe

Returns the safe version of an URL or HTML. Use this with care!

Usage: string | safe: context

Context can be one of 'HTML', 'STYLE', 'SCRIPT', 'URL', 'RESOURCE_URL' (case insensitive) depending on what content you would like to sanitize.

<img [src]="url | safe: 'url'"/> <!-- Output: safe version of the URL -->
<script [src]="url | safe: 'resource_url'"></script> <!-- Output: safe version of the URL -->
<p [innerHtml]="content | safe: 'html'"></p> <!-- Output: necessary if content contains tags like SCRIPT -->

sanitize

Returns the sanitized version of an URL or HTML. Use this with care!

Usage: string | sanitize: context

Context can be one of 'HTML', 'STYLE', 'SCRIPT', 'URL', 'RESOURCE_URL' (case insensitive) depending on what content you would like to sanitize.

<img [src]="url | sanitize: 'url'"/> <!-- Output: safe version of the URL -->
<script [src]="url | sanitize: 'resource_url'"></script> <!-- Output: safe version of the URL -->
<p [innerHtml]="content | sanitize: 'html'"></p> <!-- Output: necessary if content contains tags like SCRIPT -->

xfilter

Joins the elements of an array.

Usage: array | xfilter: customFilter

isOdd = (x) => x % 2 === 1;
<p>{{ [1, 2, 3, 4] | xfilter: isOdd }}</p> <!-- Output: "1, 3" -->

Development

This section is solely for the developers of this library, not for its users/consumers.

Publish a new version

  1. Change the version in package.json, package-lock.json and projects\nit-pipes\package.json.
  2. Run npm run publish-lib. You'll need an OTP to authenticate and publish.
  3. Push the changes in git.
  4. Create a new release on the GitHub site.