UNPKG

isharry

Version:

A simple NPM package to check if a string is 'Harry' and get its length.

51 lines (36 loc) 887 B
# isHarry A simple NPM package that checks if a string is "Harry" and provides additional string utilities. ## Installation ```sh npm install isharry ``` ## Usage ### CommonJS (CJS) ```js const { isHarry, isHarryCount } = require("isharry"); console.log(isHarry("Harry")); // true console.log(isHarry("John")); // false console.log(isHarryCount("Hello")); // 5 ``` ### ES Modules (ESM) ```js import { isHarry, isHarryCount } from "isharry"; console.log(isHarry("Harry")); // true console.log(isHarryCount("World")); // 5 ``` ## Functions ### `isHarry(name)` Checks if the given string is exactly "Harry". ```js isHarry("Harry"); // true isHarry("harry"); // false ``` ### `isHarryCount(name)` Returns the length of the given string. ```js isHarryCount("Hello"); // 5 ``` ## License MIT License --- Enjoy using **isHarry**!