search-string-eerg

1.0.1 • Public • Published

search-string

Search String is a javascript package to search string or part of it in string

Installation

Use the package manager npm to install search string.

npm i search-string-eerg --save

Usage

 <button (click)="test('juan perez')" >test</button>
import { Component } from '@angular/core';
import { customSearch } from 'search-string-eerg';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  users = [
    'juan alfredo carias perez',
    'Jhon Doe',
    'random text',
  ];

  test(query){
    const searchResult = this.users.filter(function (elem) {
        if(customSearch(elem, query)){
          return true;
        }else{ return false; }
    });
    console.log('result of search', searchResult);
  }
}


Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Package Sidebar

Install

npm i search-string-eerg

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.55 kB

Total Files

4

Last publish

Collaborators

  • eerg