Skip to content

Commit

Permalink
Require Node.js 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 23, 2020
1 parent 9e95e07 commit 1c1a48c
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 26 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 14
- 12
- 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
Get a GitHub username from an email address.
Get the GitHub username from an email address if the email can be found in any commits on GitHub.
@param email - Email address for the user of whom you want the username.
@param token - GitHub [personal access token](https:/settings/tokens/new).
@returns The username for the `email`.
@returns The username for the `email` or `undefined` if it cannot be found.
@example
```
Expand All @@ -15,6 +15,6 @@ import githubUsername = require('github-username');
})();
```
*/
declare function githubUsername(email: string, token?: string): Promise<string>;
declare function githubUsername(email: string, token?: string): Promise<string | undefined>;

export = githubUsername;
2 changes: 1 addition & 1 deletion index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {expectType} from 'tsd';
import githubUsername = require('.');

expectType<Promise<string>>(
expectType<Promise<string | undefined>>(
githubUsername('[email protected]', 'deadbeef')
);
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"description": "Get a GitHub username from an email address",
"license": "MIT",
"repository": "sindresorhus/github-username",
"funding": "https:/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
Expand All @@ -32,8 +33,8 @@
"@octokit/rest": "^18.0.6"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"ava": "^2.4.0",
"tsd": "^0.14.0",
"xo": "^0.36.1"
}
}
17 changes: 5 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# github-username [![Build Status](https://travis-ci.org/sindresorhus/github-username.svg?branch=master)](https://travis-ci.org/sindresorhus/github-username)
# github-username

> Get a GitHub username from an email address

## Install

```
$ npm install github-username
```


## Usage

```js
Expand All @@ -21,12 +19,13 @@ const githubUsername = require('github-username');
})();
```


## API

### githubUsername(email, [token])
### githubUsername(email, token?)

Get the GitHub username from an email address if the email can be found in any commits on GitHub.

Returns a `Promise<string>` with the username.
Returns a `Promise<string?>` with the username.

#### email

Expand All @@ -40,12 +39,6 @@ Type: `string`

GitHub [personal access token](https:/settings/tokens/new).


## Related

- [github-username-cli](https:/sindresorhus/github-username-cli) - CLI for this module


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)

0 comments on commit 1c1a48c

Please sign in to comment.