Gathering detailed insights and metrics for memfs-or-file-map-to-github-branch
Gathering detailed insights and metrics for memfs-or-file-map-to-github-branch
Gathering detailed insights and metrics for memfs-or-file-map-to-github-branch
Gathering detailed insights and metrics for memfs-or-file-map-to-github-branch
Lets you take either a memfs volume, or a filemap and use it to make a branch via the GitHub API
npm install memfs-or-file-map-to-github-branch
Typescript
Module System
Node Version
NPM Version
99.2
Supply Chain
97.3
Quality
76.7
Maintenance
100
Vulnerability
100
License
JavaScript (52.39%)
TypeScript (47.61%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
17 Commits
2 Forks
2 Watchers
1 Branches
3 Contributors
Updated on Mar 12, 2025
Latest Version
1.3.0
Package Id
memfs-or-file-map-to-github-branch@1.3.0
Unpacked Size
11.99 kB
Size
3.53 kB
File Count
6
NPM Version
10.8.2
Node Version
20.18.0
Published on
Mar 12, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
2
e.g. this:
1const settings = { 2 owner: "danger", 3 repo: "danger-js", 4 fullBranchReference: "heads/new_readme", 5 message: "Adds some new stuff" 6} 7 8// This will make a make a new commit on the branch new_readme, changing README.md 9await filepathContentsMapToUpdateGitHubBranch(api, { "README.md": "### My README" }, settings)
and it will make a branch on that repo with those new file contents.
1/** 2 * The config for creating a branch. Noting the repo, 3 * base branch (what should it work from), the new branch 4 * and the message for the generated commit. The commit's 5 * author will be whomever the API is authenticated with. 6 */ 7export interface BranchCreationConfig { 8 /** The danger in danger/danger-js */ 9 owner: string 10 /** The danger-js in danger/danger-js */ 11 repo: string 12 /** Base branch to start working from, null is implied to be `heads/master` */ 13 fullBaseBranch?: string 14 /** The ref in the URL must `heads/branch`, not just `branch`. */ 15 fullBranchReference: string 16 /** Message for the commit */ 17 message: string 18} 19/** Basically a filename to file contents map */ 20interface FileMap { 21 [filename: string]: string 22} 23/** 24 * Creates a bunch of blobs, wraps them in a tree, updates a reference from a memfs volume 25 */ 26export declare const memFSToGitHubCommits: ( 27 api: GitHub, 28 volume: MemFSVolume, 29 settings: BranchCreationConfig 30) => Promise<void> 31/** 32 * Creates a bunch of blobs, wraps them in a tree, updates a reference from a map of files to contents 33 */ 34export declare const filepathContentsMapToUpdateGitHubBranch: ( 35 api: GitHub, 36 fileMap: FileMap, 37 settings: BranchCreationConfig 38) => Promise<void> 39/** 40 * A Git tree object creates the hierarchy between files in a Git repository. To create a tree 41 * we need to make a list of blobs (which represent changes to the FS) 42 * 43 * We want to build on top of the tree that already exists at the last sha 44 * 45 * https://developer.github.com/v3/git/trees/ 46 */ 47export declare const createTree: ( 48 api: GitHub, 49 settings: BranchCreationConfig 50) => (fileMap: FileMap, baseSha: string) => Promise<GitHub.GitdataCreateTreeResponse> 51/** 52 * A Git commit is a snapshot of the hierarchy (Git tree) and the contents of the files (Git blob) in a Git repository 53 * 54 * https://developer.github.com/v3/git/commits/ 55 */ 56export declare const createACommit: ( 57 api: GitHub, 58 settings: BranchCreationConfig 59) => (treeSha: string, parentSha: string) => Promise<GitHub.Response<GitHub.GitdataCreateCommitResponse>> 60/** 61 * A Git reference (git ref) is just a file that contains a Git commit SHA-1 hash. When referring 62 * to a Git commit, you can use the Git reference, which is an easy-to-remember name, rather than 63 * the hash. The Git reference can be rewritten to point to a new commit. 64 * 65 * https://developer.github.com/v3/git/refs/#git-references 66 */ 67export declare const updateReference: ( 68 api: GitHub, 69 settings: BranchCreationConfig 70) => (newSha: string) => Promise<GitHub.Response<GitHub.GitdataCreateReferenceResponse>> 71export {}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 2/14 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More