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

@terminus/ngx-tools

v8.0.6

Published

[![CircleCI][circle-badge]][circle-link] [![codecov][codecov-badge]][codecov-project] [![semantic-release][semantic-release-badge]][semantic-release] [![MIT License][license-image]][license-url] <br> [![NPM version][npm-version-image]][npm-url] [![Github

Downloads

632

Readme

@terminus/ngx-tools

CircleCI codecov semantic-release MIT License NPM version Github release

A collection of tools and utilities for Terminus applications.

Table of Contents

Installation

Install the library and required dependencies:

# Primary dependencies:
$ yarn add @terminus/ngx-tools

# Peer dependencies that need to be installed (you will likely already have some of these installed):
$ yarn add @angular/{core,common,forms,platform-browser} @ngrx/{effects,store} rxjs typescript@~3.4.5

Then import your item from the associated endpoint: import { debounce } from '@terminus/ngx-tools/utilities';

You can play with the library live on StackBlitz: https://stackblitz.com/github/GetTerminus/ngx-tools

Library Structure

| Import location | Description | Docs | Size | |:----------------------------------|:--------------------------------------------------------------|:---------------------------:|:------------------------------------------------:| | @terminus/ngx-tools/browser | Helpers to deal directly with browsers (TsCookieService..) | :books: | File size | | @terminus/ngx-tools/coercion | Functions to coerce values to specific types (Array..) | :books: | File size | | @terminus/ngx-tools/jwt | Utilities for dealing with JWT tokens (TokenEscalator..) | :books: | File size | | @terminus/ngx-tools/keycodes | Constants for commonly needed key codes (ESC..) | :books: | File size | | @terminus/ngx-tools/regex | Regex definitions (creditCardRegex..) | :books: | File size | | @terminus/ngx-tools/testing | Test helpers and test mocks (dispatchFakeEvent..) | :books: | File size | | @terminus/ngx-tools/type-guards | TypeScript type guards (isSet, isArray..) | :books: | File size | | @terminus/ngx-tools/utilities | Basic utilities (debounce, groupBy..) | :books: | File size |

Features

Browser Utilities

Import from: @terminus/ngx-tools/browser

:books: Browser Documentation

// Example usage:
import { TsCookieService } from '@terminus/ngx-tools/browser';

...

this.cookieService.set('myName', 'myValue'); // Sets a cookie

Coercion

Import from: @terminus/ngx-tools/coercion

:books: Coercion Documentation

// Example usage:
import { coerceBooleanProperty } from '@terminus/ngx-tools/coercion';

coerceBooleanProperty('true'); // Returns: true

JWT Token Managment

Store, escalate, renew and use a named set of JWT tokens with ease!

:books: JWT Documentation

Key Codes

Import from: @terminus/ngx-tools/keycodes

:books: Key Codes Documentation

// Example usage:
import { KEYS } from '@terminus/ngx-tools/keycodes';
import { dispatchKeyboardEvent } from '@terminus/ngx-tools/testing';

KEYS.ENTER.code    // 'Enter'
KEYS.ENTER.keyCode // 13

// Example usage:
dispatchKeyboardEvent(myElementRef, KEYS.ENTER.keycode);

Regex

Import from: @terminus/ngx-tools/regex

:books: RegEx Documentation

// Example usage:
import { emailRegex } from '@terminus/ngx-tools/regex';

emailRegex.test('[email protected]'); // Returns: true

Testing Utilities

Import from: @terminus/ngx-tools/testing

:books: Testing Documentation

// Example usage:
import { dispatchFakeEvent } from '@terminus/ngx-tools/testing';

dispatchFakeEvent(window, 'resize');

Type Guards

Import from: @terminus/ngx-tools/type-guards

:books: Type Guards Documentation

// Example usage:
import { arrayHasAllElementsSet } from '@terminus/ngx-tools/type-guards';

arrayHasAllElementsSet<string>(['foo', 'bar']) // Returns: true
arrayHasAllElementsSet<number>([1, 'bar'])     // Returns: false

General Utilities

Import from: @terminus/ngx-tools/utilities

:books: Utilities Documentation

// Example usage:
import { groupBy } from '@terminus/ngx-tools/utilites';

groupBy<MyObj, keyof MyObj>(myArray, 'a');

Contributing

See the development workflow for the @terminus/ui library: Terminus Library Contribution Docs

Contributors

Thanks goes to these wonderful people (emoji key):

| Benjamin Charity💻 🔧 🤔 📖 💬 🐛 💡 🚇 🚧 👀 ⚠️ | Brian Malinconico💻 🤔 | Wendy💻 📖 ⚠️ 🚧 👀 | shani-terminus🐛 💻 📖 🚧 ⚠️ 👀 | | :---: | :---: | :---: | :---: |

This project follows the all-contributors specification. Contributions of any kind welcome!

Basic Commands

| Command | Function | |-----------------|--------------------------------------------------| | build | Build release | | test | Run unit tests | | test:ci:local | Run all unit tests and output coverage | | start:app | Start demo project | | lint | Lint all library files and attempt to fix issues | | lint:ci | Lint all library files | | docs:toc | Update the Table of Contents in all files | | cm | Commit with commitizen cli |

See package.json for the full list of available commands.