{"id":15979298,"url":"https://github.com/perry-mitchell/fileseg","last_synced_at":"2026-06-04T16:31:12.067Z","repository":{"id":57235858,"uuid":"92870861","full_name":"perry-mitchell/fileseg","owner":"perry-mitchell","description":"File segment fetching and replacing for configuration files","archived":false,"fork":false,"pushed_at":"2017-05-30T20:31:29.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-29T08:05:13.133Z","etag":null,"topics":["config","configparser","configuration","configuration-management","segments","settings"],"latest_commit_sha":null,"homepage":null,"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/perry-mitchell.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":"2017-05-30T19:56:58.000Z","updated_at":"2017-05-30T20:32:27.000Z","dependencies_parsed_at":"2022-08-23T15:50:56.202Z","dependency_job_id":null,"html_url":"https://github.com/perry-mitchell/fileseg","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/perry-mitchell/fileseg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Ffileseg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Ffileseg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Ffileseg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Ffileseg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perry-mitchell","download_url":"https://codeload.github.com/perry-mitchell/fileseg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Ffileseg/sbom","scorecard":{"id":728084,"data":{"date":"2025-08-11","repo":{"name":"github.com/perry-mitchell/fileseg","commit":"af35f40bd755be67a88d32b9113432e9e45b6001"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 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":"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":"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":"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":"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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":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"}}]},"last_synced_at":"2025-08-22T13:29:24.763Z","repository_id":57235858,"created_at":"2025-08-22T13:29:24.763Z","updated_at":"2025-08-22T13:29:24.763Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33914543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"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":["config","configparser","configuration","configuration-management","segments","settings"],"created_at":"2024-10-07T23:42:09.175Z","updated_at":"2026-06-04T16:31:12.048Z","avatar_url":"https://github.com/perry-mitchell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fileseg\nFile segment fetching and replacing for configuration files\n\n[![Build Status](https://travis-ci.org/perry-mitchell/fileseg.svg?branch=master)](https://travis-ci.org/perry-mitchell/fileseg) [![npm version](https://badge.fury.io/js/fileseg.svg)](https://www.npmjs.com/package/fileseg)\n\n## Installation\nSimply install by running `npm install fileseg --save`.\n\n## Usage\n`fileseg` allows for configuration block management within files. For instance you may want to control a custom block of ignored paths in a `.gitignore` file:\n\n```\nnode_modules\n*.log\n.vscode\n\n# __fileseg__ BEGIN:customConfig\nsome-application-path\nanother/path\n# __fileseg__ END:customConfig\n```\n\nReading and editing this configuration section is easy with `fileseg`:\n\n```javascript\nconst createAdapter = require(\"fileseg\");\n\nconst adapter = createAdapter(\".gitignore\");\nadapter\n    .read(\"customConfig\")\n    .then(function(config) {\n        const newConfig = [\n            ...config.split(\"\\n\"),\n            \"somefile.exe\"\n        ];\n        return adapter.write(\"customConfig\", newConfig.join(\"\\n\"));\n    });\n```\n\nThe result within `.gitignore` would be:\n\n```\nnode_modules\n*.log\n.vscode\n\n# __fileseg__ BEGIN:customConfig\nsome-application-path\nanother/path\nsomefile.exe\n# __fileseg__ END:customConfig\n```\n\nA file can have _any number_ of blocks managed by `fileseg`. A file is created automatically when writing to a path that doesn't exist. Reading a block from a non-existent file will return `null` by default (this can be overidden in the options).\n\n### Configuring\n`fileseg` can be configured by passing in a configuration object when creating the adapter:\n\n```javascript\nconst createAdapter = require(\"fileseg\");\n\nconst adapter = createAdapter(\".gitignore\", {\n    commentPrefix: \"#\",\n    blockPrefix: \" __fileseg__ \",\n    beginText: \"BEGIN:\",\n    endText: \"END:\",\n    newLine: \"\\n\",\n    noSegment: null\n});\n```\n\nYou can override the default behaviour:\n\n * `commentPrefix` is the string used to prefix block delimiters. The default `#` character is quite common in configuration files, but it can be changed to other comment characters for other markups and languages.\n * `blockPrefix` is a library-specific identifier to increase the uniqueness of the block.\n * `beginText` and `endText` configure the values to delimit the start and end of a block. These must never be the same and should usually not be changed.\n * `newLine` controls the new line characters (both recognised and replaced). This could be set, for example, to `\"\\r\\n\"` in a pure Windows project.\n * `noSegment` is the default return value for when a segment is not found (includes non-existent files).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Ffileseg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperry-mitchell%2Ffileseg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Ffileseg/lists"}