1.2.2 • Published 4 years ago

keyword-in-tweet v1.2.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Keyword In Tweet

npm.io npm.io npm.io npm.io

Contents

About

Installation

Usage

Examples

About

  • This package checks to see if the keyword you provided (irrespective of case) is in a tweet's text
    • Case is ignored
    • If the keyword contains a character that is considered, provided that character is not a reserved character
      • Reserved characters are: "@", "#", ", '
    • Link-ignoring (currently) only occurs with links that include http

Installation

npm install keyword-in-tweet

Usage

import { KeywordInTweet } from 'keyword-in-tweet';

const myTweet = {
  text: '@Person hey there!',
};
const myKeyWord = 'hey';

// KeywordInTweet would return true
const isMyKeywordPresent = KeywordInTweet(myTweet.text, myKeyword);

More Examples

Example A: With the following example, KeywordInTweet would return true

import { KeywordInTweet } from 'keyword-in-tweet';

const myTweet = {
  text: '@Person !hey! there, #HeyItsTime! @PersonTwo @HeyYou Hey',
};
const myKeyWord = 'hey';

const isMyKeywordPresent = KeywordInTweet(myTweet.text, myKeyword);

Example B: With the following example, KeywordInTweet would return false since the exact word, in that format is not in the tweet

import { KeywordInTweet } from 'keyword-in-tweet';

const myTweet = {
  text: '@Person !hey! there, #HeyItsTime! @PersonTwo @HeyYou',
};
const myKeyWord = 'hey';

const isMyKeywordPresent = KeywordInTweet(myTweet.text, myKeyword);
1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago