{"id":20446199,"url":"https://github.com/aerijo/napi-oniguruma","last_synced_at":"2026-04-16T01:32:58.300Z","repository":{"id":36659588,"uuid":"226853782","full_name":"Aerijo/napi-oniguruma","owner":"Aerijo","description":"N-API bindings for the Oniguruma regex library","archived":false,"fork":false,"pushed_at":"2022-12-30T19:20:23.000Z","size":495,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-09T11:42:56.290Z","etag":null,"topics":["napi","nodejs","oniguruma","regex"],"latest_commit_sha":null,"homepage":"","language":"C","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/Aerijo.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}},"created_at":"2019-12-09T11:19:53.000Z","updated_at":"2022-11-10T23:44:55.000Z","dependencies_parsed_at":"2023-01-17T03:50:34.809Z","dependency_job_id":null,"html_url":"https://github.com/Aerijo/napi-oniguruma","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Aerijo/napi-oniguruma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aerijo%2Fnapi-oniguruma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aerijo%2Fnapi-oniguruma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aerijo%2Fnapi-oniguruma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aerijo%2Fnapi-oniguruma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aerijo","download_url":"https://codeload.github.com/Aerijo/napi-oniguruma/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aerijo%2Fnapi-oniguruma/sbom","scorecard":{"id":9086,"data":{"date":"2025-08-11","repo":{"name":"github.com/Aerijo/napi-oniguruma","commit":"5ee67073bd31bda5cce4e82471909be65ae58f84"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.5,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":-1,"reason":"No tokens found","details":null,"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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"}},{"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":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.1.0 not signed: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22411528","Warn: release artifact v0.0.5 not signed: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22403818","Warn: release artifact v0.0.4 not signed: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22403749","Warn: release artifact v0.0.3 not signed: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22403698","Warn: release artifact v0.0.2 not signed: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22403636","Warn: release artifact v0.1.0 does not have provenance: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22411528","Warn: release artifact v0.0.5 does not have provenance: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22403818","Warn: release artifact v0.0.4 does not have provenance: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22403749","Warn: release artifact v0.0.3 does not have provenance: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22403698","Warn: release artifact v0.0.2 does not have provenance: https://api.github.com/repos/Aerijo/napi-oniguruma/releases/22403636"],"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 'master'"],"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":"Vulnerabilities","score":0,"reason":"31 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T14:10:20.649Z","repository_id":36659588,"created_at":"2025-08-14T14:10:20.649Z","updated_at":"2025-08-14T14:10:20.649Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274537075,"owners_count":25303969,"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-09-10T02:00:12.551Z","response_time":83,"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":["napi","nodejs","oniguruma","regex"],"created_at":"2024-11-15T10:18:24.086Z","updated_at":"2025-10-14T05:34:25.600Z","avatar_url":"https://github.com/Aerijo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/Aerijo/napi-oniguruma.svg?branch=master)](https://travis-ci.com/Aerijo/napi-oniguruma)\n[![Dependency Status](https://david-dm.org/Aerijo/napi-oniguruma.svg)](https://david-dm.org/Aerijo/napi-oniguruma)\n[![DevDependency Status](https://david-dm.org/Aerijo/napi-oniguruma/dev-status.svg)](https://david-dm.org/Aerijo/napi-oniguruma/?type=dev)\n\n# napi-oniguruma\n\nN-API bindings for the Oniguruma regex library\n\n## Features\n\nThis module uses the lastest Oniguruma regex release (6.9.4), and aims to keep it up to date. It uses N-API bindings, allowing the same binary to work across [all future NodeJS versions](https://nodejs.org/en/docs/guides/abi-stability/#n-api). The implementation is based on `node-oniguruma`, but rewritten in C, some interface differences, and with added promise support.\n\nTo interface with the regular expressions, there is a choice of\n- Synchronous calls with `scanner.findNextMatchSync` (fastest, but blocks the main thread)\n- Callbacks with `scanner.findNextMatchCb` (regex match is run on separate thread)\n- Promises with `scanner.findNextMatch` (same as callbacks)\n\n\n## Performance\n\nWhen I run the `node-oniguruma` benchmarks on it's own library, I get the following results\n```\noneline.js\nsync:  149652 matches in 1778ms\nlarge.js\nsync:  14594 matches in 162ms\nSegmentation fault (core dumped)\n```\n\nWhen I run the same benchmarks on this library, I get\n```\noneline.js\nsync:  149652 matches in 2985ms\nlarge.js\nsync:  14594 matches in 186ms\nasync: 14594 matches in 1055ms\n```\n\nThey tend to have some variance, but the above figures are fairly typical. From the above results, you can expect a significant performance drop when run on a single line JSON, and a 1.15 times slowdown when searching for `'this', 'var', 'selector', 'window'` on the JQuery source.\n\nIn general, a drop in performance is to be expected. N-API is an abstraction over the underlying JS VM, so cannot compete with `node-oniguruma` using the V8 API's. However, what we lose in performance we gain in stability, so you can depend on prebuilt binaries being valid without active maintenance. I am interested in seeing if NAN bindings can also be implemented in this project too though, and comparing their performance to those in `node-oniguruma`.\n\nIn a point to this library though, we don't segfault on async operations. Improving the benchmarks to better reflect real usage is a goal for this module.\n\n\n\n## Thread safety\n\nThe entry and exit points of all async methods run on the main thread, so are inherently safe. The biggest concern is the work that gets done in the threadpool. In particular, the regex cannot cache results without protection. To fix this, we only update the cache during sync searches (where everything runs on the main thread). The goal will be to eventually add atomic operations to update values, even during async work (but Windows VS doesn't seem to support atomics). Maybe even make the cache a separate object, so a regex can have multiple caches, etc.\n\n\n## Indexing\n\nThe API supports starting from a given index within the string. This has been interpreted as JS string index, and not unicode code point or similar. Hopefully support for actual code point indexing can be added.\n\n\n## NOTE\n- There is a bug in Node 10.15.3--12.0.0 that causes a memory leak when using the async (promise and callback) methods.\n\n\n## TODO\n- [X] Refactor C code to reduce duplication\n- [X] Fix the G anchor detection\n- [X] Comprehensive tests\n- [ ] Set up proper benchmarks\n- [X] Typescript types\n- [ ] ~~Batch the property setting into a single N-API call~~\n  - Not done, as could not detect any measurable improvement, and makes the properties invisible to the tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerijo%2Fnapi-oniguruma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faerijo%2Fnapi-oniguruma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerijo%2Fnapi-oniguruma/lists"}