@begit/core
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

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,
 },
 "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,
 },
 "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,
 },
 "cool_project",
});

Package Sidebar

Install

npm i @begit/core

Weekly Downloads

43

Version

0.3.1

License

MIT

Unpacked Size

32.3 kB

Total Files

12

Last publish

Collaborators

  • thomas_beer