Socket
Book a DemoInstallSign in
Socket

is-kris

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-kris

A utility package to detect variations of the name Chris/Kris in strings

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

is-kris

A lightweight, zero-dependency TypeScript utility for detecting variations of the name Chris/Kris in strings.

npm version License: MIT

Supported Name Variations

Recognizes these patterns (case-insensitive):

  • Chris: Chris, Chriss
  • Kris: Kris, Kriss, Khris
  • Christopher: Christopher, Christoph
  • Kristopher: Kristopher, Kristoph
  • Other variants: Christofer, Cristofer, Christoffer, Kristoffer

Installation

npm install is-kris

Usage

import { isKris, isExactlyKris, findKris, countKris, REGEX } from "is-kris";

// Check if string contains any Chris/Kris variation
isKris("Hello Chris"); // true
isKris("John"); // false

// Check if string is exactly a Chris/Kris variation
isExactlyKris("Chris"); // true
isExactlyKris("Hello Chris"); // false

// Find all variations in a string
findKris("Chris and Kris are friends"); // ['Chris', 'Kris']

// Count variations in a string
countKris("Chris, Kris, and Christopher"); // 3

// Access the underlying regex
console.log(REGEX); // /\b(?:c|ch|k|kh)ri(?:s|ss|st(?:o(?:ph(?:er)?|fer|ffer)))\b/i

// You can also use Chris aliases
import { isChris, findChris, countChris, isExactlyChris } from "is-kris";

isChris("Hello Christopher"); // true
findChris("Chris and Kris"); // ['Chris', 'Kris']

API Reference

isKris(input: string): boolean

Checks if a string contains any variation of Chris/Kris.

isExactlyKris(input: string): boolean

Checks if a string is exactly a variation of Chris/Kris.

findKris(input: string): string[]

Returns array of all Chris/Kris variations found in the string.

countKris(input: string): number

Returns the number of Chris/Kris variations found.

REGEX: RegExp

The underlying regular expression pattern.

Error Handling

All functions handle invalid inputs gracefully:

isKris(null); // false
findKris(undefined); // []
countKris(123); // 0

Performance & Compatibility

  • Optimized regex for fast matching
  • Lightweight bundle (~2KB)
  • Works in Node.js 18+, all modern browsers, Bun, and Deno

Development

git clone https://github.com/RostiMelk/is-kris.git
cd is-kris
bun install
bun test
bun run build

Keywords

chris

FAQs

Package last updated on 15 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts