# github-keys

> find the public keys of a given github user

Latest version **1.0.1** (published 2015-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install github-keys
pnpm add github-keys
yarn add github-keys
bun add github-keys
```

Provides the command `github-keys`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-01-18 |
| First published | 2015-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Michael Rhodes |
| Maintainers | michaelrhodes |
| Keywords | github, user, public, keys |

## Links

- npm: https://www.npmjs.com/package/github-keys
- Repository: git@github.com:michaelrhodes/github-keys
- Homepage: https://github.com/michaelrhodes/github-keys
- Issues: https://github.com/michaelrhodes/github-keys/issues
- npm.io page: https://npm.io/package/github-keys

## Dependencies (5)

- [split2](https://npm.io/package/split2.md) ~0.2.1
- [through2](https://npm.io/package/through2.md) ~0.6.3
- [hyperquest](https://npm.io/package/hyperquest.md) ~1.0.1
- [through2-map](https://npm.io/package/through2-map.md) ~1.4.0
- [stream-splicer](https://npm.io/package/stream-splicer.md) ~1.3.1

## Recent versions

- 1.0.1 (latest) — 2015-01-18
- 1.0.0 — 2015-01-17

## README

# github-keys
github-keys is a simple module that finds the public keys of a given Github user. Its code is based on a private function in [substack/cipherhub](https://github.com/substack/cipherhub/blob/0f18084aa45b32be85e8bd73aa5457f534a73522/bin/cmd.js#L185-L201), however github-keys maintains a streaming API and doesn’t filter the returned keys.

[![Build status](https://travis-ci.org/michaelrhodes/github-keys.png?branch=master)](https://travis-ci.org/michaelrhodes/github-keys)

## Install
``` sh
$ npm install [-g] github-keys
```

### Usage
```js
var keys = require('github-keys')
var through = require('through2')

keys('alice').pipe(through(
  function (key, enc, next) {
    console.log(key.toString())
    next()
  }
))
```

#### w/callbacks
Sometimes you just want all the keys in an array,
so github-keys provides an alternate endpoint to
facilitate that use-case.

```js
var keys = require('github-keys/all')

keys('alice', function (err, array) {
  console.log(array)
})
```

##### Running the usage examples
To run either of these examples in node or the browser, use the following commands:

```sh
# node
$ npm run example
$ npm run example-all

# browser, obviously
$ npm run example-browser
$ npm run example-all-browser
```

Because Github doesn’t support [CORS](http://enable-cors.org/) for the `/{user}.keys` endpoint, github-keys needs to go through a [reverse proxy](https://github.com/Rob--W/cors-anywhere/) in order to work in the browser. This is easily configured, however, with the browserify transform, [envify](https://github.com/hughsk/envify):

```js
$ CORS_PROXY='http://cors.proxy.com/' browserify -t envify program.js > bundle.js
``` 

### Command-line usage
If you install github-keys with the `-g` flag, you can access the command-line version:

```sh
$ github-keys {username}
```



### License
[MIT](http://opensource.org/licenses/MIT)

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