2.1.1 • Published 1 year ago

ng-letter-count-2 v2.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

letter-count for Angular

This library was generated with Angular CLI version 15.1.0.

Table of contents

Installation

  1. Use npm to install the package:
$ npm install ng-letter-count-2 --save 
  1. Use yarn to install the package:
$ yarn add ng-letter-count-2

Useage

  1. You could either add into your module imports the NgLetterCountModule in order to add everything.

    import { NgLetterCountModule } from 'ng-letter-count-2';
    
    @NgModule({
     // ...
     imports: [
       // ...
       NgLetterCountModule
     ]
    })
  2. Or Pipes are also injectable and can be used in Components / Services / etc..

    import { NgLetterCountPipe } from 'ng-letter-count-2';
    
    @Component({
      // ..
      providers: [NgLetterCountPipe]
    })
    export class AppComponent {
      public title = 'AppComponent by Tom S.';
      
      constructor(private readonly ngLetterCountPipe: NgLetterCountPipe) {
        ngLetterCountPipe.transform(this.title, '-w'); // Returns: 4
      }
      // ..
    }
  3. You can use pipes as part of your template for ex.

<p>{{ 'AppComponent by Tom S.' | letterCount }}</p> <!-- Output: 22 -->

and it's also possible to stack multiple pipes

<p>{{title | uppercase | letterCount: '-c'}}</p> <!-- Output: 22 -->

Options

Counts the:

TypeOption
▶ characters'-c' or '--char'
▶ lines'-ln' or '--lines'
▶ words'-w' or '--words'
▶ numbers'-n' or '--numbers'
▶ integers'-int' or '--integers'
▶ floats'-fl' or '--floats'
▶ spaces'-s' or '--spaces'
▶ letters'-l' or '--letters'
▶ wordsigns'-ws' or '--wordsigns'
⭐ Generates a hash (MD5)'-hs' or '--hash'

ℹ Full description


NPM

https://npmjs.com/package/ch.techstack.ng-lib-workspace


Doc

jsdoc logo


RinKit

https://npm.runkit.com/ng-letter-count-2


Links

Author

techstack.ch

ShieldsIO


License

This library is available under the MIT license.


2.1.1

1 year ago

2.1.0

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago