-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.d.ts
47 lines (39 loc) · 787 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export type UserInfo = {
/**
The user's name.
*/
name: string | undefined;
/**
The URL to user's avatar.
*/
avatar: string | undefined;
/**
The user's email.
*/
email: string | undefined;
/**
The user's associated GitHub account.
*/
github: string | undefined;
/**
The user's associated Twitter account.
*/
twitter: string | undefined;
};
/**
Get user info of an npm user.
@param name - The user's username on npm.
@example
```
import npmUser from 'npm-user';
console.log(await npmUser('sindresorhus'));
// {
// name: 'Sindre Sorhus',
// avatar: 'https://www.npmjs.com/npm-avatar/…',
// email: 'sindresorhus@gmail.com',
// github: 'sindresorhus',
// twitter: 'sindresorhus'
// }
```
*/
export default function npmUser(name: string): Promise<UserInfo>;