Skip to content

Saber2pr/git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@saber2pr/git

simple git.

yarn add @saber2pr/git

Example

import { diff, commit } from "@saber2pr/git"

const rootDir = "./test"
const commits = await diff(rootDir)
await commit(commits)

commits like this:

[
  {
    "type": "create",
    "master": { "path": "./test/item2.md", "text": "233\n" },
    "origin": { "path": "__test__/item2.md" }
  },
  {
    "type": "update",
    "master": { "path": "./test/item2.md", "text": "qwq\n" },
    "origin": { "path": "__test__/item2.md", "text": "233\n" }
  },
  {
    "type": "delete",
    "master": { "path": "./test/item2.md" },
    "origin": { "path": "__test__/item2.md" }
  }
]

start

yarn install
yarn start

yarn test

Author: saber2pr

About

simple git.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published