{"id":17551430,"url":"https://github.com/taufik-nurrohman/pattern","last_synced_at":"2026-04-27T21:31:45.840Z","repository":{"id":57164656,"uuid":"314699962","full_name":"taufik-nurrohman/pattern","owner":"taufik-nurrohman","description":"Regular expression utility.","archived":false,"fork":false,"pushed_at":"2024-01-04T13:45:17.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T23:23:58.085Z","etag":null,"topics":["expression","helper","node","pattern","regex","regexp","regular","utility"],"latest_commit_sha":null,"homepage":"","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/taufik-nurrohman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-11-21T00:19:35.000Z","updated_at":"2023-08-16T06:20:40.000Z","dependencies_parsed_at":"2024-01-29T06:01:51.496Z","dependency_job_id":"635a93f2-3223-4b75-ae42-8ba93b62ede9","html_url":"https://github.com/taufik-nurrohman/pattern","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/taufik-nurrohman/pattern","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taufik-nurrohman%2Fpattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taufik-nurrohman%2Fpattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taufik-nurrohman%2Fpattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taufik-nurrohman%2Fpattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taufik-nurrohman","download_url":"https://codeload.github.com/taufik-nurrohman/pattern/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taufik-nurrohman%2Fpattern/sbom","scorecard":{"id":869607,"data":{"date":"2025-08-11","repo":{"name":"github.com/taufik-nurrohman/pattern","commit":"754939e14839e45bdcd26feb2db269bcf4dd064c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/taufik-nurrohman/pattern/npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/taufik-nurrohman/pattern/npm.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/npm.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-24T03:44:48.997Z","repository_id":57164656,"created_at":"2025-08-24T03:44:48.997Z","updated_at":"2025-08-24T03:44:48.997Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["expression","helper","node","pattern","regex","regexp","regular","utility"],"created_at":"2024-10-21T04:45:54.564Z","updated_at":"2026-04-27T21:31:45.825Z","avatar_url":"https://github.com/taufik-nurrohman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Regular Expression Utility\n==========================\n\nUsage\n-----\n\n### CommonJS\n\n~~~ js\nconst {toPattern} = require('@taufik-nurrohman/pattern');\n\nconsole.log(toPattern('[a-z]+'));\n~~~\n\n### ECMAScript\n\n~~~ js\nimport {toPattern} from '@taufik-nurrohman/pattern';\n\nconsole.log(toPattern('[a-z]+'));\n~~~\n\nMethods\n-------\n\n### esc(pattern, extra = \"\")\n\nEscape regular expression characters in string except `\\`.\n\n### escChar(pattern, extra = \"\")\n\nEscape regular expression characters for character class only. E.g. `^`, `[`, `]`, and `-`.\n\n### extractInner(content, start, end, opt = \"\")\n\nExtract nesting constructs in a string.\n\n~~~ js\nconsole.log(extractInner('a(b(c))d(e)f((g)h)', '\\\\(', '\\\\)'));\n~~~\n\n~~~ js\n[\n    ['b(c)', [\n        ['c', [], 2, 3]\n    ], 2, 6],\n    ['e', [], 9, 10],\n    ['(g)h', [\n        ['g', [], 1, 2]\n    ], 13, 17]\n]\n~~~\n\n### extractTokens(content, tokens, defaultTokenName = 0)\n\n~~~ js\nconsole.log(extractTokens('This is an \u003ca href=\"https://example.com\"\u003eactive link\u003c/a\u003e and an \u003ca\u003eempty link\u003c/a\u003e.', [\n    ['(\u003c)([\\\\w:-]+)(\\\\s[^\u003e]*?)?(\u003e)', ['tag', 'p', 'name', [\n        ['\"[^\"]+\"', 'value'],\n        ['=', 'p'],\n        ['[\\\\w:-]+', 'key']\n    ], 'p']],\n    ['(\u003c)(/)([\\\\w:-]+)(\u003e)', ['tag', 'p', 'p', 'name', 'p']]\n]));\n~~~\n\n~~~ js\n[\n    [['This is an '], [0]],\n    [['\u003ca href=\"https://example.com\"\u003e', '\u003c', 'a', ' href=\"https://example.com\"', '\u003e'], ['tag', 'p', 'name', [\n        [[' '], [0]],\n        [['href'], ['key']],\n        [['='], [\"p\"]],\n        [['\"https://example.com\"'], ['value']]\n    ], 'p']],\n    [['active link'], [0]],\n    [['\u003c/a\u003e', '\u003c', '/', 'a', '\u003e'], ['tag', 'p', 'p', 'name', 'p']],\n    [[' and an '], [0]],\n    [['\u003ca\u003e', '\u003c', 'a', undefined, '\u003e'], ['tag', 'p', 'name', 0, 'p']],\n    [['empty link'], [0]],\n    [['\u003c/a\u003e', '\u003c', '/', 'a', '\u003e'], ['tag', 'p', 'p', 'name', 'p']],\n    [['.'], [0]]\n]\n~~~\n\n### fromPattern(pattern)\n\nGet pattern from `RegExp` as string.\n\n### isPattern(x)\n\nDetect if `x` is an instance of `RegExp`.\n\n### token(start, content|contents, end = start, skip)\n\nBuild pattern string from parameters.\n\n~~~ js\nconsole.log(token('\"'));\n~~~\n\n### tokenGroup(start, content|contents, end = start, skip)\n\nBuild pattern string from parameters as a group of `start`, `content` and `end`.\n\n~~~ js\nconsole.log(tokenGroup('\"'));\n~~~\n\n### toPattern(string, opt = 'g')\n\nConvert pattern string to `RegExp` instance.\n\n### x\n\nList of regular expression\u0026rsquo;s special characters except `\\`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaufik-nurrohman%2Fpattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaufik-nurrohman%2Fpattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaufik-nurrohman%2Fpattern/lists"}