# @pengliheng/github-report

> generate a github report

Latest version **1.6.13** (published 2018-07-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install @pengliheng/github-report
pnpm add @pengliheng/github-report
yarn add @pengliheng/github-report
bun add @pengliheng/github-report
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.13 |
| Published | 2018-07-24 |
| First published | 2018-03-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 10.3 MB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | pengliheng |
| Maintainers | pengliheng |

## Links

- npm: https://www.npmjs.com/package/@pengliheng/github-report
- Repository: https://github.com/pengliheng/github-report
- Homepage: https://chat.pipk.top/githubReport/pengliheng
- Issues: https://github.com/pengliheng/github-report/issues
- npm.io page: https://npm.io/package/@pengliheng/github-report

## Dependencies (9)

- [axios](https://npm.io/package/axios.md) ^0.18.0
- [react](https://npm.io/package/react.md) ^16.4.1
- [chart.js](https://npm.io/package/chart.js.md) ^2.7.2
- [react-dom](https://npm.io/package/react-dom.md) ^16.4.1
- [lodash.sortby](https://npm.io/package/lodash.sortby.md) ^4.7.0
- [parcel-bundler](https://npm.io/package/parcel-bundler.md) ^1.9.7
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^2.1.6
- [github-calendar](https://npm.io/package/github-calendar.md) ^1.2.1
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^4.3.1

## Recent versions

- 1.6.13 (latest) — 2018-07-24
- 1.6.12 — 2018-07-24
- 1.6.11 — 2018-07-24
- 1.6.10 — 2018-07-24
- 1.6.9 — 2018-07-24
- 1.6.8 — 2018-07-24
- 1.6.7 — 2018-07-24
- 1.5.8 — 2018-05-28
- 1.5.7 — 2018-05-27
- 1.5.6 — 2018-05-24
- 1.5.5 — 2018-05-24
- 1.5.4 — 2018-05-24
- 1.5.3 — 2018-05-24
- 1.5.1 — 2018-05-24
- 1.4.7 — 2018-05-24
- … 52 more at https://npm.io/package/@pengliheng/github-report/versions

## README

[![author](https://img.shields.io/badge/author-peng-blue.svg)](https://www.pipk.top)
[![Node.js Version](https://img.shields.io/badge/node.js-9.2.0-blue.svg)](http://nodejs.org/download)
![Size](https://github-size-badge.herokuapp.com/pengliheng/github-report.svg)

### to generate an github report

### [example](https://chat.pipk.top/githubReport/pengliheng)

```js
url = 'https://chat.pipk.top/githubReport/<userName>';
```
![](https://static.pipk.top/api/public/images/8536904566607304.png)
<!-- ## 1.you need to have an router `/graphql`,and i will post request to github url `https://api.github.com/graphql`, so please paste the below code to your router(`/graphql`) config,if you wana to use.

```js
const axios = require("axios");
exports.getCode = async ctx => {
  const query = ctx.request.body;
  const queryFunc = async data =>
    new Promise((resolve, reject) => {
      axios({
        url: "https://api.github.com/graphql",
        method: "post",
        headers: {
          Authorization: `bearer ${process.env.access_token}`,
          "Content-Type": "application/json"
        },
        data
      })
        .then(res => resolve(res.data))
        .catch(err => reject(err));
    });
  ctx.body = await queryFunc(query);
}; -->
<!-- ``` -->

<!-- ## 2.generate an [github access_token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)

* #### pay attention to avoid below thing!dont put your access token into headers,because github may think it an dangerout behave thing, and they will cancel your token immediately.

```js
axios({
  url: "https://api.github.com/graphql",
  method: "post",
  headers: {
    Authorization: `bearer <your token>`,
    "Content-Type": "application/json"
  },
  data
})
  .then(res => resolve(res.data))
  .catch(err => reject(err));
```

![](https://cdn.suisuijiang.com/message_1520156894273.png) -->

<!-- ## 3.to set environment variable

```js
// nodejs
// nodemon => create file => nodemonrc.json
{
  "verbose": true,
  "env": {
    "access_token": "your personal token",
    "NODE_ENV": "dev"
  }
}

// pm2 => create file => ecosystem.config.js
module.exports = {
  apps: [
    {
      name: "blog",
      script: "./src/server/index.js",
      watch: true,
      env: {
        "PORT": 80,
        "NODE_ENV": "dev",
        "access_token": "your personal token",
      },
      env_prod: {
        "PORT": 8001,
        "NODE_ENV": "prod",
        "access_token": "your personal token",
      }
    }
  ]
} -->

<!-- // centos/linux
// set access_token=yourToken
// export access_token=yourToken
// not sure just google/baidu
``` -->

### 1.just use it as your react component

<!-- ```jsx
// package
import React, { Component } from "react";
import Github from "@pengliheng/github-report";
import '@pengliheng/github-report/lib/index.less';

class Root extends Component {
  render() {
    return (
      <div className="github">
        <Github name="yinxin630"/>
      </div>
    );
  }
}

render(
  <Root />,
  document.getElementById('root'),
);
``` -->

### you can input it while your router change
```jsx
const GithubReport = props => (
  <div className="github-report">
    <Github {...props} />
  </div>
);

// router 
<Route path="/githubReport/:name" component={GithubReport} />

```

<!-- ```js
axios({
  url: 'https://chat.pipk.top/graphql',
  method: 'post',
  // url: `https://api.github.com/graphql`,
  // method: 'post',
  // headers: {
  //   'Authorization': `bearer ${process.env.access_token}`,
  //   'Content-Type': 'application/json'
  // },
  data: {
    query: `{
      search(query: "${args.name||'pengliheng'}", type: USER, first: 1) {    
        edges {
          node {
            ... on User {
              avatarUrl login bio url createdAt
              contributedRepositories(first: 100,orderBy: {field: CREATED_AT, direction: DESC}) {
                totalCount
                nodes{
                  nameWithOwner url
                }
              }
              starredRepositories(first:100) {
                nodes {
                  primaryLanguage {
                    name color
                  }
                }
              }
            }
          }
        }
      }
    }`,
  },
}).then(res => resolve(res.data.data))
  .catch(err => reject(err))
})
``` -->

---
_Source: https://npm.io/package/@pengliheng/github-report · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
