{"id":16644144,"url":"https://github.com/devxprite/value-extractor","last_synced_at":"2026-03-05T19:05:34.298Z","repository":{"id":113715752,"uuid":"585066494","full_name":"devxprite/value-extractor","owner":"devxprite","description":"A simple JavaScript library for extracting values from string based on a pattern","archived":false,"fork":false,"pushed_at":"2023-02-07T11:19:45.000Z","size":52,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T18:53:18.454Z","etag":null,"topics":["npm","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/value-extractor","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/devxprite.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":"2023-01-04T08:27:35.000Z","updated_at":"2024-07-30T04:14:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"24eb1ef5-3012-412d-8d47-e9bb87c7a5ae","html_url":"https://github.com/devxprite/value-extractor","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/devxprite/value-extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2Fvalue-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2Fvalue-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2Fvalue-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2Fvalue-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devxprite","download_url":"https://codeload.github.com/devxprite/value-extractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2Fvalue-extractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30144702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: 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":["npm","npm-package"],"created_at":"2024-10-12T08:10:34.165Z","updated_at":"2026-03-05T19:05:34.269Z","avatar_url":"https://github.com/devxprite.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## value-extractor\n\nThis is a simple and easy-to-use JavaScript library that allows you to extract values from a string based on a pattern. It is useful when you have a string with a predictable structure and you want to extract specific values from it.\n\n\n\u003c!-- for cdn --\u003e\n### Use in Browser\n\nUse directly in the browser with [jsDelivr](https://www.jsdelivr.com/package/npm/value-extractor) or [unpkg](https://unpkg.com/value-extractor/).\n\n```html \n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n    \u003cbody\u003e\n        \u003cscript src=\"https://cdn.jsdelivr.net/npm/value-extractor@latest\"\u003e\u003c/script\u003e\n        \u003cscript\u003e\n        const str = \"change 100 kg to pounds\";\n        const pattern = \"change {quantity} {from_unit} to {to_unit}\";\n    \n        const values = valueExtractor(str, pattern);\n        console.log(values)\n        // OUTPUT :\n        // {\n        //     quantity: \"100\",\n        //     from_unit: \"kg\",\n        //     to_unit: \"pounds\"\n        // }\n        \u003c/script\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Install as a NPM package\n\nTo install `value-extractor` package, run the following command:\n```bash\nnpm i value-extractor\n```\n### Usage\nTo use the String Value Extractor, import the extractValues function and call it with a string and a pattern:\n\n```javascript\nimport valueExtractor from 'value-extractor';\n\nconst values = valueExtractor('/2012/08/12/test.html', '/{year}/{month}/{day}/{title}.html');\n\nconsole.log(values);\n// Output: { \"year\": \"2012\", \"month\": \"08\", \"day\": \"12\", \"title\": \"test\" }\n```\nThe `extractValues` function returns an object with keys based on the pattern, and values based on the extracted values.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevxprite%2Fvalue-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevxprite%2Fvalue-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevxprite%2Fvalue-extractor/lists"}