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
81.1
Supply Chain
96.7
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (52.39%)
TypeScript (47.61%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
89,028,414
Last Day
106,097
Last Week
521,900
Last Month
2,238,822
Last Year
24,608,890
MIT License
3 Stars
14 Commits
2 Forks
3 Watchers
1 Branches
3 Contributors
Updated on Feb 01, 2022
Minified
Minified + Gzipped
Latest Version
1.2.1
Package Id
memfs-or-file-map-to-github-branch@1.2.1
Unpacked Size
12.00 kB
Size
3.55 kB
File Count
6
NPM Version
6.14.15
Node Version
14.18.1
Cumulative downloads
Total Downloads
Last Day
6.2%
106,097
Compared to previous day
Last Week
3.5%
521,900
Compared to previous week
Last Month
47.8%
2,238,822
Compared to previous month
Last Year
18.8%
24,608,890
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
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/12 approved changesets -- 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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-03
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