{"id":18396723,"url":"https://github.com/igorskyflyer/npm-chars-in-string","last_synced_at":"2026-05-11T05:36:39.934Z","repository":{"id":57118106,"uuid":"386805185","full_name":"igorskyflyer/npm-chars-in-string","owner":"igorskyflyer","description":"🪐 Provides ways of testing whether an array of chars is present inside a given String. ☄","archived":false,"fork":false,"pushed_at":"2023-05-03T22:53:42.000Z","size":173,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T15:06:01.330Z","etag":null,"topics":["back-end","characters","chars","check","igorskyflyer","javascript","mocha","node","nodejs","string","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@igor.dvlpr/chars-in-string","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igorskyflyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-17T01:20:21.000Z","updated_at":"2022-10-20T18:53:49.000Z","dependencies_parsed_at":"2024-12-24T10:30:00.461Z","dependency_job_id":"d1f9f956-bfa8-43ad-bf7a-8435912d291e","html_url":"https://github.com/igorskyflyer/npm-chars-in-string","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"473306218dc875582e94206e2500cfbba8510c40"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-chars-in-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-chars-in-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-chars-in-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-chars-in-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorskyflyer","download_url":"https://codeload.github.com/igorskyflyer/npm-chars-in-string/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586235,"owners_count":21128997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["back-end","characters","chars","check","igorskyflyer","javascript","mocha","node","nodejs","string","utility"],"created_at":"2024-11-06T02:14:39.311Z","updated_at":"2026-05-11T05:36:39.923Z","avatar_url":"https://github.com/igorskyflyer.png","language":"JavaScript","funding_links":["https://ko-fi.com/igorskyflyer"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/igorskyflyer/npm-chars-in-string/main/media/chars-in-string.png\" alt=\"Icon of Chars in String\" width=\"256\" height=\"256\"\u003e\n  \u003ch1\u003eChars in String\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003ch4 align=\"center\"\u003e\n  🪐 Determines whether an array of chars is present inside a given String. ☄\n\u003c/h4\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 📃 Table of Contents\n\n- [Features](#-features)\n- [Usage](#-usage)\n- [API](#-api)\n- [Examples](#️-examples)\n- [Changelog](#-changelog)\n- [Support](#-support)\n- [License](#-license)\n- [Related](#-related)\n- [Author](#-author)\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🤖 Features\n\n- 🔍 Find instantly - See if your text contains what you’re looking for\n- 🎯 Target precisely - Match at the start, end, or anywhere in the text\n- 🔠 Match your way - Choose case‑sensitive or case‑insensitive search\n- 🧮 Works with one or many - Search for single characters or whole words/phrases\n- ⚡ Quick answers - Stops searching as soon as a match is found\n- 🌍 Cross‑platform friendly - Works the same on any OS or environment\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🕵🏼 Usage\n\nInstall it by executing any of the following, depending on your preferred package manager:\n\n```bash\npnpm add @igorskyflyer/chars-in-string\n```\n\n```bash\nyarn add @igorskyflyer/chars-in-string\n```\n\n```bash\nnpm i @igorskyflyer/chars-in-string\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🤹🏼 API\n\nAn `enum` is available publicly, used for setting the position of the search, see more below. 👇\n\n```ts\nenum Position {\n  Any,\n  Start,\n  End\n}\n```\n\nIt allows you define where the matching should occur, at the **beginning** of the `String`, at the **end** or **anywhere** (default).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n```ts\nfunction charsInString(characters: string[], input: string, position = Position.Any, caseSensitive = true): boolean\n```\n\n`characters: string[]` - the characters to search for, expects a single character per entry, if multiple are found it will take the first one,\n\n`input: string` - the String which needs to be checked,\n\n`[position: Position=Position.Any]` - controls where the matching should occur, at the **beginning** of the `String`, at the **end** or **anywhere** (default),\n\n`[caseSensitive: boolean=true]` - controls whether the search is case-sensitive, defaults to `true`.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n```ts\nfunction stringsInString(strings, input, position = Position.Any, caseSensitive = true): boolean\n```\n\n`strings[]: string[]` - the strings to search for,\n\n`input: string` - the String which needs to be checked,\n\n`[position: Position=Position.Any]` - controls where the matching should occur, at the **beginning** of the `String`, at the **end** or **anywhere** (default),\n\n`[caseSensitive: boolean=true]` - controls whether the search is case-sensitive, defaults to `true`.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🗒️ Examples\n\n```ts\nimport { charsInString, stringsInString, Position } from '@igorskyflyer/chars-in-string'\n\nconsole.log(charsInString([], '')) // prints false\nconsole.log(charsInString([], 'test')) // prints false\nconsole.log(charsInString([':', ','], '')) // prints false\nconsole.log(charsInString([':', ','], 'hello:world')) // prints true\nconsole.log(charsInString([':', ',', '^'], 'helloworld^')) // prints true\nconsole.log(charsInString([':', ',', '^'], 'helloworld')) // prints false\nconsole.log(stringsInString(['abc', 'owom', 'wqp', 'world', 'hel'], 'helloworld', Position.Start)) // prints true\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 📝 Changelog\n\n📑 The changelog is available here, [CHANGELOG.md](https://github.com/igorskyflyer/npm-chars-in-string/blob/main/CHANGELOG.md).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🪪 License\n\nLicensed under the MIT license which is available here, [MIT license](https://github.com/igorskyflyer/npm-chars-in-string/blob/main/LICENSE).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 💖 Support\n\n\u003cdiv align=\"center\"\u003e\n  I work hard for every project, including this one and your support means a lot to me!\n  \u003cbr\u003e\n  Consider buying me a coffee. ☕\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://ko-fi.com/igorskyflyer\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/igorskyflyer/igorskyflyer/main/assets/ko-fi.png\" alt=\"Donate to igorskyflyer\" width=\"180\" height=\"46\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cem\u003eThank you for supporting my efforts!\u003c/em\u003e 🙏😊\n\u003c/div\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🧬 Related\n\n[@igorskyflyer/str-is-in](https://www.npmjs.com/package/@igorskyflyer/str-is-in)\n\n\u003e _🧵 Provides ways of checking whether a String is present in an Array of Strings using custom Comparators. 🔍_\n\n\u003cbr\u003e\n\n[@igorskyflyer/recursive-readdir](https://www.npmjs.com/package/@igorskyflyer/recursive-readdir)\n\n\u003e _📖 Provides recursive readdir() and readdirSync() functions. 📁_\n\n\u003cbr\u003e\n\n[@igorskyflyer/astro-post-excerpt](https://www.npmjs.com/package/@igorskyflyer/astro-post-excerpt)\n\n\u003e _⭐ An Astro component that renders post excerpts for your Astro blog - directly from your Markdown and MDX files. Astro v2+ collections are supported as well! 💎_\n\n\u003cbr\u003e\n\n[@igorskyflyer/adblock-filter-counter](https://www.npmjs.com/package/@igorskyflyer/adblock-filter-counter)\n\n\u003e _🐲  A dead simple npm module that counts Adblock filter rules.🦘_\n\n\u003cbr\u003e\n\n[@igorskyflyer/scramble](https://www.npmjs.com/package/@igorskyflyer/scramble)\n\n\u003e _🃏 Scrambles (rearranges randomly) Strings and Arrays. 🎋_\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 👨🏻‍💻 Author\nCreated by **Igor Dimitrijević** ([*@igorskyflyer*](https://github.com/igorskyflyer/)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorskyflyer%2Fnpm-chars-in-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorskyflyer%2Fnpm-chars-in-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorskyflyer%2Fnpm-chars-in-string/lists"}