@db-man/github
TypeScript icon, indicating that this package has built-in type declarations

0.1.63 • Public • Published

github

How to use Github class:

import { Github } from '@db-man/github';

const github = new Github({
  personalAccessToken: 'your personal access token',
  owner: 'your github username',
  repoName: 'your repo name',
});

github.getFileContentAndSha('/path/to/file').then(({ content, sha }) => {
  console.log(content, sha);
});

How to use GithubDb class:

import { GithubDb } from '@db-man/github';

const dbsSchema = {
  iam: {
    name: 'iam',
    description: 'iam db',
    tables: [
      {
        name: 'users',
        large: false,
      },
    ],
  },
};

const githubDb = new GithubDb({
  personalAccessToken: 'your personal access token',
  repoPath: 'db_files_dir',
  dbsSchema,
  owner: 'your github username',
  repoName: 'your repo name',
});

githubDb.getTableRows('iam', 'users').then(({ content, sha }) => {
  console.log(content, sha);
});

Readme

Keywords

none

Package Sidebar

Install

npm i @db-man/github

Weekly Downloads

377

Version

0.1.63

License

MIT

Unpacked Size

225 kB

Total Files

81

Last publish

Collaborators

  • xxd3vin