Skip to content

Commit

Permalink
Update index.js: use of githubApiGetProject
Browse files Browse the repository at this point in the history
  • Loading branch information
roebi authored Aug 1, 2024
1 parent b7e3ed9 commit e2b50f7
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,45 @@
export {};

import { getGithubTopics } from 'github-api-get';
import { githubApiGetProject, getGithubTopics } from 'github-api-get';
import { GITHUB_PROJECT_TOPICS } from './consts.js';

async function realdataTopicsWithPathExpression() {
const loginName = 'roebi';
const projectName = '01-01-vanilla-HTML5-starter-page';
const infoLog = true;
const isProd = true;
const githubTopics = githubApiGetProject(
loginName,
projectName,
GITHUB_PROJECT_TOPICS,
infoLog,
isProd
); // as Promise<string[]>;

const realGithubTopics = await githubTopics;
console.group(
'realGithubTopics, call of githubApiGetProject with constant GITHUB_PROJECT_TOPICS'
);
console.info('realGithubTopics');
console.info(realGithubTopics);
console.groupEnd();
}

async function getGithubTopicsfromgithub() {
const loginName = 'roebi';
const projectName = '01-01-vanilla-HTML5-starter-page';
const infoLog = true;
const isProd = true;
// this call is deprecated, use githubApiGetProject with constant GITHUB_PROJECT_TOPICS
const githubTopics = getGithubTopics(loginName, projectName, infoLog, isProd); // as Promise<string[]>;

const realGithubTopics = await githubTopics;
console.group('realGithubTopics');
console.group('realGithubTopics, deprecated call getGithubTopics');
console.info('realGithubTopics');
console.info(realGithubTopics);
console.groupEnd();
}

await realdataTopicsWithPathExpression();
console.info();
await getGithubTopicsfromgithub();

0 comments on commit e2b50f7

Please sign in to comment.