0.3.3 • Published 6 months ago

@begit/core v0.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Begit Core

npm package minimized gzipped size

Cloning to a directory

import { downloadRepo } from "@begit/core";
await downloadRepo({
 repo: {
  owner: "Tommypop2",
  name: "begit",
  branch: undefined,
  subdir: undefined,
 },
 dest: "cool_project",
});

The code above downloads this repository into a folder named cool_project.

Alternatively, downloadAndExtract could be used in place of downloadRepo to opt out of automatically attempting to handle errors

Providing a custom commit hash

import { downloadRepo } from "@begit/core";

const custom_hash = "9e4e51beb1ac76e6c37be1757f14b904617a2f9b";

await downloadRepo({
 repo: {
  owner: "Tommypop2",
  name: "begit",
  branch: undefined,
  subdir: undefined,
  hash: custom_hash,
 },
 dest: "cool_project",
});

Fetching the most recent cached commit

import { downloadRepo } from "@begit/core";

const most_recent_hash = await getMostRecentCachedCommit("Tommypop2", "begit"); // string | undefined

await downloadRepo({
 repo: {
  owner: "Tommypop2",
  name: "begit",
  branch: undefined,
  subdir: undefined,
  hash: most_recent_hash,
 },
 dest: "cool_project",
});

Using a fetcher

import { downloadRepo, matchFetcher } from "@begit/core";
const fetcher = matchFetcher("github");

await downloadRepo({
 repo: {
  owner: "Tommypop2",
  name: "begit",
  branch: undefined,
  subdir: undefined,
  hash: most_recent_hash,
 },
 dest: "cool_project",
}, fetcher);
0.1.0

10 months ago

0.3.0

7 months ago

0.2.1

7 months ago

0.1.2

10 months ago

0.2.0

8 months ago

0.1.1

10 months ago

0.3.2

6 months ago

0.1.4

10 months ago

0.3.1

7 months ago

0.1.3

10 months ago

0.3.3

6 months ago

0.1.5

10 months ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago