{"id":16543335,"url":"https://github.com/cak/larp","last_synced_at":"2025-10-15T22:24:16.690Z","repository":{"id":129322642,"uuid":"154068781","full_name":"cak/larp","owner":"cak","description":"Lightweight Asynchronous Regex Project","archived":false,"fork":false,"pushed_at":"2024-10-16T09:11:06.000Z","size":7,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T16:38:56.615Z","etag":null,"topics":["regex","regexp"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/larp","language":"TypeScript","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/cak.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-22T01:05:54.000Z","updated_at":"2022-03-22T19:38:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"f81a2e89-bd8b-4ec0-b1ef-8626241074d4","html_url":"https://github.com/cak/larp","commit_stats":null,"previous_names":["cakinney/larp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cak/larp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Flarp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Flarp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Flarp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Flarp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cak","download_url":"https://codeload.github.com/cak/larp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Flarp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279122026,"owners_count":26108353,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"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":["regex","regexp"],"created_at":"2024-10-11T18:59:57.262Z","updated_at":"2025-10-15T22:24:16.643Z","avatar_url":"https://github.com/cak.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LARP\n\nLightweight Asynchronous Regex Project\n\nLARP is a library that uses stored regex patterns and returns the pattern matches in a promise. You can also use URLs or filenames as the argument with an options parameter and LARP will parse the source code of the page or text from the file as arguments for the regex marching. More powerful regex magic than a level 15 spell caster!\n\n## Usage\n\n### Install\n\n    npm install larp\n\n#### Modules\n\nImport: `import * as larp from \"larp\";`  \nRequire: `const larp = require(\"larp\");`\n\n#### Matching\n\n- Email Addresses\n  _ `email(arg: string, options?: config)`\n  _ Example match: _john.doe@example.com_\n- URLS\n  _ `url(arg: string, options?: config)`\n  _ Example match: _http://www.example.com_\n- IPv4 Addresses\n  _ `ipv4(arg: string, options?: config)`\n  _ Example match: _127.0.0.1_\n- HTML src Attribute Values\n  _ `src(arg: string, options?: config)`\n  _ Example match: _~~src=\"~~ /javascripts/main.js ~~\"\u003e~~_\n- HTML href Attribute Values\n  _ `href(arg: string, options?: config)`\n  _ Example match: _~~href=\"~~ /examples\" ~~\u003e~~_\n\n#### Config (optional)\n\n- **url**\n  _ `{ url: true }`\n  _ Use argument as _URL_ location and URL source will be matched.\n- **file**\n  _ `{ file: true }`\n  _ Use argument as _file_ location and file text will be matched.\n\n## Examples (basic)\n\nThe string argument specifies the text to be matched.\n\n```javascript\nlarp.email(\"Lorem ipsum john.doe@example.com dolor sit amet.\");\n    =\u003e Promise: [ 'john.doe@example.com' ]\n\nlarp.url(\"Lorem ipsum https://www.example.com dolor sit amet.\");\n    =\u003e Promise: [ 'https://www.example.com' ]\n\nlarp.ipv4(\"Lorem ipsum 127.0.0.1 dolor sit amet.\");\n    =\u003e Promise: [ '127.0.0.1' ]\n\nlarp.src(\"\u003ch1\u003eLorem ipsum\u003c/h1\u003e\u003cimg src=\"unicorn.png\"\u003e\u003ch1\u003edolor sit amet.\u003c/h1\u003e\");\n    =\u003e Promise: [ 'unicorn.png' ]\n\nlarp.href(\"\u003ch1\u003eLorem ipsum\u003c/h1\u003e\u003ca href=\"/unicorns.html\"\u003eUnicorns\u003c/a\u003e\u003ch1\u003edolor sit amet.\u003c/h1\u003e\");\n    =\u003e Promise: [ '/unicorns.html' ]\n```\n\n## Examples (options)\n\nThe string argument specifies the filename when option { file: true } is provided:\n\n```javascript\nlarp.ipv4(\"sample.txt\", { file: true })\n\t=\u003e Promise: [ '127.0.0.1' ]\n```\n\nThe string argument specifies the URL location when option { url : true } is provided:\n\n```javascript\nlarp.href(\"http://www.example.com\", { url: true })\n\t=\u003e Promise: [ '/stylesheets/style.css', '/examples' ]\n```\n\n## Attribution\n\n- URL Regex from [John Gruber](https://daringfireball.net/2010/07/improved_regex_for_matching_urls)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcak%2Flarp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcak%2Flarp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcak%2Flarp/lists"}