{"id":20671428,"url":"https://github.com/fajarbc/anagram-palindrome","last_synced_at":"2026-04-27T05:32:53.685Z","repository":{"id":60584642,"uuid":"544103307","full_name":"fajarbc/anagram-palindrome","owner":"fajarbc","description":"Find anagram words if existed from the given pattern. Check if two strings are anagram. Check if the given word is palindrome.","archived":false,"fork":false,"pushed_at":"2022-10-10T18:30:24.000Z","size":154,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-19T13:46:37.725Z","etag":null,"topics":["anagram","hacktoberfest2022","hactoberfest","javascript","npm-package","palindrome","typescript"],"latest_commit_sha":null,"homepage":"https://fajarbc.github.io/anagram-palindrome/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fajarbc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-01T16:50:36.000Z","updated_at":"2022-10-10T18:06:34.000Z","dependencies_parsed_at":"2023-01-19T19:47:28.476Z","dependency_job_id":null,"html_url":"https://github.com/fajarbc/anagram-palindrome","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/fajarbc/anagram-palindrome","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fanagram-palindrome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fanagram-palindrome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fanagram-palindrome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fanagram-palindrome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fajarbc","download_url":"https://codeload.github.com/fajarbc/anagram-palindrome/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fanagram-palindrome/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32324545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["anagram","hacktoberfest2022","hactoberfest","javascript","npm-package","palindrome","typescript"],"created_at":"2024-11-16T20:27:11.617Z","updated_at":"2026-04-27T05:32:53.655Z","avatar_url":"https://github.com/fajarbc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [anagram-palindrome](https://fajarbc.github.io/anagram-palindrome)\n\n[![npm version](https://badge.fury.io/js/anagram-palindrome.svg)](https://badge.fury.io/js/anagram-palindrome)\n\nFind anagram words if existed from the given pattern. Check if two strings are anagram. Check if the given word is palindrome.\n\nIt has npm package here called [anagram-palindrome](https://www.npmjs.com/package/anagram-palindrome)\n\n**Support CJS and ESM**\n\n## Install\n```sh\nnpm i anagram-palindrome\n```\n\n## Usage\n### ESM Style\n```javascript\nimport { findPattern, areAnagram, isPalindrome } from \"anagram-palindrome\"\n\n// findPattern\nconsole.log(findPattern(\"car\", \"race car care\")) // [ 'rac', 'car', 'arc', 'rca', 'car' ]\nconsole.log(findPattern(\"car\", \"race car care\", {unique: true})) // [ 'rac', 'car', 'arc', 'rca' ]\nconsole.log(findPattern(\"car\", \"race car care\", {space: true})) // [ 'rac', 'car', 'car' ]\nconsole.log(findPattern(\"car\", \"race car care\", {space: true, unique: true})) // [ 'rac', 'car' ]\nconsole.log(findPattern(\"cAr\", \"race car cAre\", {caseSensitive: true})) // [ 'rcA', 'cAr' ]\n\n// areAnagram\nconsole.log(areAnagram(\"mything\", \"My night\")) // true\nconsole.log(areAnagram(\"mything\", \"My night\", {space: true})) // false\nconsole.log(areAnagram(\"Thing\", \"Night\", {caseSensitive: true})) // false\nconsole.log(areAnagram(\"My thing\", \"My night\", {caseSensitive: true, space: true})) // true\nconsole.log(areAnagram(\"Mything\", \"My Night\", {caseSensitive: true, space: true})) // false\n\n// isPalindrome\nconsole.log(isPalindrome(\"Race car\")) // true\nconsole.log(isPalindrome(\"Racecar\", {caseSensitive: true})) // false\nconsole.log(isPalindrome(\"race car\", {space: true})) // false\nconsole.log(isPalindrome(\"Rac e caR\", {caseSensitive: true, space: true})) // true\nconsole.log(isPalindrome(\"Race car\", {caseSensitive: true, space: true})) // false\n```\n\n### CJS Style\n```javascript\nconst { findPattern, areAnagram, isPalindrome } = require(\"anagram-palindrome\")\n\n// findPattern\nconsole.log(findPattern(\"car\", \"race car care\")) // [ 'rac', 'car', 'arc', 'rca', 'car' ]\n```\n\n### In Browser\nIf you are using this directly in your browser, you could use `type=\"module\"` in your `script` tag. Here, I'm using **unpkg.com** as cdn source to call package `anagram-palindrome` version `0.3.2` and stright to file `dist/index.mjs`.\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { findPattern } from 'https://unpkg.com/anagram-palindrome@0.3.2/dist/index.mjs';\n\n  console.log(findPattern(\"car\", \"race car care\")) // [ 'rac', 'car', 'arc', 'rca', 'car' ]\n\u003c/script\u003e\n```\nor import all function\n```html\n\u003cscript type=\"module\"\u003e\n  import * as ap from 'https://unpkg.com/anagram-palindrome@0.3.2/dist/index.mjs';\n\n  console.log(ap.findPattern(\"car\", \"race car care\")) // [ 'rac', 'car', 'arc', 'rca', 'car' ]\n\u003c/script\u003e\n```\nYou can change cdn from **unpkg.com** to **jsdelivr.net** by replacing \n`https://unpkg.com/anagram-palindrome@0.3.2/dist/index.mjs`\n\nwith\n\n`https://cdn.jsdelivr.net/npm/anagram-palindrome@0.3.2/dist/index.mjs`\n\n## Function\nRead complete [API documentation here](https://fajarbc.github.io/anagram-palindrome/docs/index.html)\n\n### findPattern\n```findPattern(pattern, text, options)```\n- Description: return anagram words/sequences from the given string (text) if any\n- Return type `array`\n- `pattern` (string) is the sequence string you look for in in the string `text`\n- `text` (string) is the whole string you want to look for the `pattern`\n- `options` (object) is an object to customize the options desribed bellow:\n  | Parameter | Type | Deafult | Description |\n  |:----------|:----:|:-------:|:------------|\n  | space | boolean | false | `true` means space counted as a character.\u003cbr\u003e `false` means space is not counted as character and will be ignored |\n  | caseSensitive | boolean | false | `true` means case sensitive character.\u003cbr\u003e `false` means case insensitive |\n  | unique | boolean | false | `true` only return unique sequence result.\u003cbr\u003e `false` will return all sequence result |\n- Example use :\n    ```javascript\n    import { findPattern } from \"anagram-palindrome\"\n\n    console.log(findPattern(\"car\", \"race car care\", {space: true, unique: true})) // [ 'rac', 'car' ]\n    ```\n\n### areAnagram\n```areAnagram(word1, word2, options)```\n- Description: Check if two strings are anagram\n- Return type `boolean`. `true` if they are anagram, `false` if it is not anagram\n- `word1` and `word2` is the text/string you you want to check wether if they are anagram or not\n- `options` (object) is an object to customize the options desribed bellow:\n\n  | Parameter | Type | Deafult | Description |\n  |:----------|:----:|:-------:|:------------|\n  | space | boolean | false | `true` means space counted as a character.\u003cbr\u003e `false` means space is not counted as character and will be ignored |\n  | caseSensitive | boolean | false | `true` means case sensitive character.\u003cbr\u003e `false` means case insensitive |\n- Example use :\n    ```javascript\n    import { areAnagram } from \"anagram-palindrome\"\n    console.log(areAnagram(\"Thing\", \"Night\", {caseSensitive: true})) // false\n    console.log(areAnagram(\"Thing\", \"Night\")) // true\n    ```\n\n### isPalindrome\n```isPalindrome(word, options)```\n- Description: Check if the word is palindrome\n- Return type `boolean`. `true` if the word palindrome, `false` if it is not palindrome\n- `word` is the text/string you you want to check if it is palindrome or not\n- `options` (object) is an object to customize the options desribed bellow:\n\n  | Parameter | Type | Deafult | Description |\n  |:----------|:----:|:-------:|:------------|\n  | space | boolean | false | `true` means space counted as a character.\u003cbr\u003e `false` means space is not counted as character and will be ignored |\n  | caseSensitive | boolean | false | `true` means case sensitive character.\u003cbr\u003e `false` means case insensitive |\n- Example use :\n    ```javascript\n    import { isPalindrome } from \"anagram-palindrome\"\n    console.log(isPalindrome(\"Race car\")) // true\n    console.log(isPalindrome(\"Racecar\", {caseSensitive: true})) // false\n    console.log(isPalindrome(\"race car\", {space: true})) // false\n    ```\n# Changelog\nRead full [Changlog here](https://fajarbc.github.io/anagram-palindrome/CHANGELOG.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffajarbc%2Fanagram-palindrome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffajarbc%2Fanagram-palindrome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffajarbc%2Fanagram-palindrome/lists"}