{"id":18803988,"url":"https://github.com/jimic/nsri","last_synced_at":"2025-09-09T22:42:50.202Z","repository":{"id":33977702,"uuid":"165027363","full_name":"JimiC/nsri","owner":"JimiC","description":"Node.js utility tool for creating and checking subresource integrity","archived":false,"fork":false,"pushed_at":"2023-10-24T06:16:03.000Z","size":1751,"stargazers_count":10,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T08:47:07.782Z","etag":null,"topics":["integrity","node","nodejs","nsri","subresource","typescript"],"latest_commit_sha":null,"homepage":null,"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/JimiC.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2019-01-10T09:08:07.000Z","updated_at":"2024-07-15T02:36:08.000Z","dependencies_parsed_at":"2025-04-13T18:47:46.423Z","dependency_job_id":null,"html_url":"https://github.com/JimiC/nsri","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/JimiC/nsri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimiC%2Fnsri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimiC%2Fnsri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimiC%2Fnsri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimiC%2Fnsri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JimiC","download_url":"https://codeload.github.com/JimiC/nsri/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimiC%2Fnsri/sbom","scorecard":{"id":72813,"data":{"date":"2025-08-11","repo":{"name":"github.com/JimiC/nsri","commit":"8df3c54a8bcc909d6e130eab95c131b75371c2e2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"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":"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":"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/coverage.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.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":"Dangerous-Workflow","score":0,"reason":"dangerous workflow patterns detected","details":["Warn: untrusted code checkout '${{ github.event.workflow_run.head_sha }}': .github/workflows/coverage.yml:22"],"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":"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":"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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:106: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:118: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/coverage.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/coverage.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/coverage.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/JimiC/nsri/publish.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand 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":"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":-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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"11 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-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"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-15T04:12:18.160Z","repository_id":33977702,"created_at":"2025-08-15T04:12:18.161Z","updated_at":"2025-08-15T04:12:18.161Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274374774,"owners_count":25273824,"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-09T02:00:10.223Z","response_time":80,"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":["integrity","node","nodejs","nsri","subresource","typescript"],"created_at":"2024-11-07T22:37:49.715Z","updated_at":"2025-09-09T22:42:50.181Z","avatar_url":"https://github.com/JimiC.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033--\u003e\n# nsri (NodeJS Subresource Integrity) \u003cimg src=\"https://raw.githubusercontent.com/jimic/nsri/main/media/nsri-logo.png\" width=\"50\" align=\"left\"\u003e\n\n### General Info\n\n[![License](https://img.shields.io/github/license/jimic/nsri)](https://raw.githubusercontent.com/jimic/nsri/main/LICENSE)\n![Semantic Version](https://img.shields.io/badge/semver-2.0.0-green)\n![npm type definitions](https://img.shields.io/npm/types/nsri)\n\n### Release Info\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/jimic/nsri)\n![node-current](https://img.shields.io/node/v/nsri?label=supported%20node%20versions)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/nsri)\n\n### Development Info\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/jimic/nsri)\n![node-dev](https://img.shields.io/badge/dynamic/json?color=brightgreen\u0026label=supported%20node%20versions\u0026query=engines.node\u0026url=https%3A%2F%2Fraw.githubusercontent.com%2FJimiC%2Fnsri%2Fmaster%2Fpackage.json)\n\n![Build Status](https://github.com/JimiC/nsri/actions/workflows/build.yml/badge.svg)\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/77bea27f9bd1906ac525/maintainability)](https://codeclimate.com/github/jimic/nsri/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/77bea27f9bd1906ac525/test_coverage)](https://codeclimate.com/github/jimic/nsri/test_coverage)\n\n[![Known Vulnerabilities](https://snyk.io/test/github/jimic/nsri/badge.svg?targetFile=package.json)](https://snyk.io/test/github/jimic/nsri?targetFile=package.json)\n\n---\n\nA [Node.js](https://nodejs.org) utility tool that creates an integrity object containing the hash checksums of a file or a directory structure, that can be saved to an `.integrity.json` file [\u003cimg src=\"https://raw.githubusercontent.com/jimic/nsri/main/media/integrity_file.png\" width=\"16\" /\u003e], or put inside the project's manifest file (`project.json`).\n\nThe hashes are computed using, by default, the `sha1` algorithm for files and `sha512` algorithm for directories, with `base64` encoding, complying to [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) spec, but other [Node.js crypto](https://nodejs.org/api/crypto.html) supported [algorithms](https://nodejs.org/api/crypto.html#cryptogethashes) and [encodings](https://nodejs.org/api/crypto.html#hashdigestencoding) can be used.\n\n## Instalation\n\nTo install as a dependency, simply type:\n\n```sh\nnpm i nsri --save\n```\n\nTo install for global use, simply type:\n\n```sh\nnpm i nsri -g\n```\n\n## Behavior\n\n**NOTE:**\n\n- The `.integrity.json` file itself is being excluded in all computations.\n- The `node_modules`, `.git*`, `.svn*`, `.hg*` directories are excluded by default.\n\n### Files\n\n**Hashes are the same when:**\n\n- File names and contents are the same\n\n**Hashes are different when:**\n\n- File names are different and contents are the same\n- File contents are different and names are the same\n\n### Directories\n\nContents: The file names (and their data contents) and subdirectories names (with their contents) of the directory\n\n**Hashes are the same when:**\n\n- Directory names and contents are the same `(strict: true)`\n- Only root directory names are different and subdirectory names and all contents are the same `(strict: false)`\n\n**Hashes are different when:**\n\n- Directory names are different and contents are the same `(strict: true)`\n- Directory contents are different and names are the same\n\n## Usage\n\n### CLI\n\n`nsri` has a built-in command-line inteface.\n\n```sh\nnsri \u003ccommand\u003e [options]\n```\n\nTo see the available `commands` type:\n\n```sh\nnsri -h\n```\n\nand for available `command` options type:\n\n```sh\nnsri \u003ccommand\u003e -h\n```\n\nMore info an be found at the [CLI](https://github.com/JimiC/nsri/blob/main/docs/cli.md) section.\n\n### API\n\n`nsri` can also be used programatically ([TypeScript](https://www.typescriptlang.org/) types are included).\n\nMore info can be found at the [API](https://github.com/JimiC/nsri/blob/main/docs/api.md) section.\n\n### Configuration\n\n#### Config File\n\n`nsri` supports [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) configuration.\n\nValid config filenames are: `.nsrirc`, `.nsrirc.js`, `.nsrirc.json`, `.nsrirc.yaml`, `.nsrirc.yml`, `.nsrirc.config.js`. In `package.json` the property name MUST be `nsri`.\n\n**NOTE:**  Configurations set via `CLI` are overriding configurations set via `cosmiconfig`. To avoid confusion use one or the other.\n\n#### Ignore File\n\nExclusions also can be set via an ignore file (`.nsriignore`), which supports the [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) pattern format.\n\n**NOTE:** ExclusionsExclutionsExclutions set via `CLI` or `cosmiconfig` are getting merged with those in the ignore file and from those only unique entries are assigned.\n\n### Integrity object schema\n\n```json\n{\n  \"version\": ... schema version,\n  \"hashes\": ... verbosely or non-verbosely computed hashes\n}\n```\n\nMore info on the used schema can be found [here](https://github.com/JimiC/nsri/blob/main/src/schemas).\n\n#### Verbosely hashes schema\n\n```json\n{\n  \"directoryName\": {\n    \"contents\": {\n      \"aFileName\":  ... file computed hash string,\n      \"anotherFileName\":  ... file computed hash string\n    },\n    \"hash\": ... directory computed hash string\n  }\n}\n```\n\nExamples of a verbosely computed hash integrity file can be found [here](https://github.com/JimiC/nsri/blob/main/test/fixtures).\n\n#### Non-verbosely hashes schema\n\n```json\n{\n  \"fileOrDirectoryName\": ... file or directory computed hash string\n}\n```\n\n### Examples\n\nExamples on how to use `nsri`, via `CLI` or `API`, can be found at the [examples](https://github.com/JimiC/nsri/blob/main/docs/examples) section.\n\nIf you believe that the examples are incomplete or incorrect, please submit an issue or better yet a PR.\n\n## Contributing\n\nIf you like to contribute make sure to check-out the [Contribution Guidelines](https://github.com/JimiC/nsri/blob/main/.github/CONTRIBUTING.md) section.\n\n## License\n\nThis project is licensed under the [MIT](https://github.com/JimiC/nsri/blob/main/LICENSE) license.\n\n## Versioning\n\nThis project follows [Semantic Versioning 2.0.0](https://semver.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimic%2Fnsri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimic%2Fnsri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimic%2Fnsri/lists"}