https://github.com/tau-engineering/linkify-gh-usernames
Linkify GitHub usernames
https://github.com/tau-engineering/linkify-gh-usernames
Last synced: about 1 year ago
JSON representation
Linkify GitHub usernames
- Host: GitHub
- URL: https://github.com/tau-engineering/linkify-gh-usernames
- Owner: tau-engineering
- License: mit
- Created: 2018-07-24T11:19:24.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-12-19T21:54:38.000Z (over 1 year ago)
- Last Synced: 2025-05-13T00:57:02.108Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://npm.im/linkify-gh-usernames
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# linkify-gh-usernames
> Linkify GitHub usernames
## Install
> [!NOTE]
> This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
```
npm install linkify-gh-usernames
```
## Usage
```js
import linkifyUsernames from "linkify-gh-usernames";
linkifyUsernames(
"Hi @yeskunall and welcome to the @21kb org! Feel free to look around!",
{
attributes: {
class: "github",
target: "_blank",
},
},
);
//=> 'Hi @yeskunall and welcome to the @21kb org! Feel free to look around!
```
## API
### linkifyUsernames(input, [options])
#### input
Type: `string`
Text containing valid GitHub username.
#### options
Type: `Object`
##### attributes
Type: `Object`
HTML attributes to add to the link.
##### value
Type: `string`
Default: The URL
Set a custom HTML value for the link.
## Related
- [linkify-issues](https://github.com/sindresorhus/linkify-issues) - Linkify
GitHub issue references
- [linkify-urls](https://github.com/sindresorhus/linkify-urls) - Linkify URLs in
text