Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

uses isomorphic-git and memfs to host an in-memory git repo

NotificationsYou must be signed in to change notification settings

jmsv/memgit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usesisomorphic-git andmemfs to host an in-memory git repo!

(At the moment it's just a proof-of-concept - I'm not sure what to do about git's compressed objects although there's probably a way to magically store them as text)

why did u make this tho

I don't have much use for this and made it for fun tbh, although it could potentially be useful for storing a git repo in a document-based (e.g. MongoDB) database

In the future (given time and motivation) I might get this working properly and turn it into something more reusable


The code I wrote trying to get this to work:

varfsReal=require('fs')varfs=require('memfs').fsvarvol=require('memfs').volvargit=require('isomorphic-git')git.plugins.set('fs',fs)asyncfunctionmain(){awaitgit.init({dir:'/'})fs.writeFileSync('/avocado.txt','avocado content')awaitgit.add({dir:'/',filepath:'/avocado.txt'})awaitgit.commit({dir:'/',author:{name:'James Vickery',email:'dev@jamesvickery.net'},message:'added avocado'})constrepoJson=vol.toJSON()fsReal.writeFileSync('repo.json',JSON.stringify(repoJson,null,2))}main()

output

About

uses isomorphic-git and memfs to host an in-memory git repo

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp