{"id":29945820,"url":"https://github.com/nonplain/nonplain-md-backlinker.js","last_synced_at":"2026-04-18T14:04:44.008Z","repository":{"id":57312035,"uuid":"346542464","full_name":"nonplain/nonplain-md-backlinker.js","owner":"nonplain","description":"Generate backlinks for nonplain markdown files","archived":false,"fork":false,"pushed_at":"2022-01-23T20:18:40.000Z","size":465,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T15:56:45.517Z","etag":null,"topics":["backlinks","links","markdown","nonplain","notes","vimwiki"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nonplain-md-backlinker","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/nonplain.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":"2021-03-11T01:31:24.000Z","updated_at":"2024-12-14T09:18:46.000Z","dependencies_parsed_at":"2022-09-14T14:20:20.969Z","dependency_job_id":null,"html_url":"https://github.com/nonplain/nonplain-md-backlinker.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nonplain/nonplain-md-backlinker.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonplain%2Fnonplain-md-backlinker.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonplain%2Fnonplain-md-backlinker.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonplain%2Fnonplain-md-backlinker.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonplain%2Fnonplain-md-backlinker.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nonplain","download_url":"https://codeload.github.com/nonplain/nonplain-md-backlinker.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonplain%2Fnonplain-md-backlinker.js/sbom","scorecard":{"id":693868,"data":{"date":"2025-08-11","repo":{"name":"github.com/nonplain/nonplain-md-backlinker.js","commit":"8d36fca2a458dc0673d4143191abe7bea1b9c1d1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/22 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":"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":"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":"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":"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":"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":"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":"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":"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":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-22T03:02:26.979Z","repository_id":57312035,"created_at":"2025-08-22T03:02:26.979Z","updated_at":"2025-08-22T03:02:26.979Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["backlinks","links","markdown","nonplain","notes","vimwiki"],"created_at":"2025-08-03T05:02:10.209Z","updated_at":"2026-04-18T14:04:40.685Z","avatar_url":"https://github.com/nonplain.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nonplain-md-backlinker\n\nGenerate backlinks for [nonplain files](https://github.com/nonplain/nonplain.js#what-a-nonplain-file-is).\n\n## What this package does\n\nGroups of related markdown files often link to one another. This is especially true for groups of files that contain notes (e.g. [VimWiki](https://vimwiki.github.io/)) or documentation.\n\nLinks between files reflect [conceptual relationships](https://jaredgorski.org/notes/linking-notes-by-title-promotes-conceptual-cohesion) between those files, but links are uni-directional by default (they only go forward, not backward).\n\nThe concept: make it easy to generate backlinks for individual files in a [nonplain `Files`](https://github.com/nonplain/nonplain.js#parsing-nonplain-files) instance.\n\n## Usage\n\n```js\nbacklinker(files [, options]);\n```\n\nThe `backlinker` function exported by this package will automatically generate backlinks for all files in a `Files` instance and inject them into each `File`'s metadata as `backlinks`.\n\nTo generate backlinks for a group of files that link to each other, load those files into a [nonplain `Files`](https://github.com/nonplain/nonplain.js) instance and then pass that instance to the `backlinker` function.\n\nExample:\n\n```js\nconst Files = require(\"nonplain\").default;\nconst backlinker = require(\"nonplain-md-backlinker\").default;\n\nconst files = new Files().load('/path/to/dir/**/*.md');\n\nbacklinker(files);\n\nconsole.log(files.collect());\n\n// Output:\n//\n// [\n//     {\n//         \"body\": \"This is the body of\\nthe first file\",\n//         \"metadata\": {\n//             \"backlinks\": [\n//                 {\n//                     \"file\": {\n//                         \"root\": \"/\",\n//                         \"dir\": \"/path/to/dir\",\n//                         \"base\": \"file2.md\",\n//                         \"ext\": \".md\",\n//                         \"name\": \"file2\"\n//                     },\n//                     \"title\": \"My file 2\"\n//                 }\n//             ],\n//             \"file\": {\n//                 \"root\": \"/\",\n//                 \"dir\": \"/path/to/dir\",\n//                 \"base\": \"file1.md\",\n//                 \"ext\": \".md\",\n//                 \"name\": \"file1\"\n//             },\n//             \"title\": \"My file 1\"\n//         }\n//     },\n//     {\n//         \"body\": \"This is the body of\\nthe second file\",\n//         \"metadata\": {\n//             \"backlinks\": [\n//                 {\n//                     \"file\": {\n//                         \"root\": \"/\",\n//                         \"dir\": \"/path/to/dir\",\n//                         \"base\": \"file1.md\",\n//                         \"ext\": \".md\",\n//                         \"name\": \"file1\"\n//                     },\n//                     \"title\": \"My file 1\"\n//                 }\n//             ],\n//             \"file\": {\n//                 \"root\": \"/\",\n//                 \"dir\": \"/path/to/dir\",\n//                 \"base\": \"file2.md\",\n//                 \"ext\": \".md\",\n//                 \"name\": \"file2\"\n//             },\n//             \"title\": \"My file 2\",\n//         }\n//     }\n// ]\n```\n\n### API\n\n- `files`: `Files` instance - An instance of [nonplain.js' `Files` class](https://github.com/nonplain/nonplain.js#parsing-nonplain-files).\n- options:\n  - `keyFn`: function ((directory, path) =\u003e fileKey) - Customize the function used to identify each file so that its backlinks can be identified. By default, the absolute filepath (minus extension) is used.\n  - `metadataProperty` _(default: 'backlinks')_: string - Customize the property on the `metadata` object to assign the backlinks array to.\n\n## Related work\n\n- Core nonplain library for JS: [nonplain.js](https://github.com/nonplain/nonplain.js)\n- Tools for markdown links in nonplain files: [nonplain-md-link.js](https://github.com/nonplain/nonplain-md-link.js)\n\n## Contributing\n\nIf your use-case requires specific functionality from this library, please contact me and we'll see what we can do together. Thanks!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonplain%2Fnonplain-md-backlinker.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnonplain%2Fnonplain-md-backlinker.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonplain%2Fnonplain-md-backlinker.js/lists"}