username

WebJar for username

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

username
Последняя версия

Последняя версия

2.3.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

username
WebJar for username
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/sindresorhus/username

Скачать username

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/username/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>username</artifactId>
    <version>2.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/username/
implementation 'org.webjars.npm:username:2.3.0'
// https://jarcasting.com/artifacts/org.webjars.npm/username/
implementation ("org.webjars.npm:username:2.3.0")
'org.webjars.npm:username:jar:2.3.0'
<dependency org="org.webjars.npm" name="username" rev="2.3.0">
  <artifact name="username" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='username', version='2.3.0')
)
libraryDependencies += "org.webjars.npm" % "username" % "2.3.0"
[org.webjars.npm/username "2.3.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : execa jar [0.4.0,0.5)
org.webjars.npm : mem jar [0.1.0,0.2)

Модули Проекта

Данный проект не имеет модулей.

username Build Status

Get the username of the current user

This module is meant for informational purposes and not for secure identification.

Install

$ npm install username

This package only works in Node.js, not in browsers.

Usage

const username = require('username');

(async () => {
	console.log(await username());
	//=> 'sindresorhus'
})();

API

It first tries to get the username from the SUDO_USER LOGNAME USER LNAME USERNAME environment variables. Then falls back to $ id -un on macOS / Linux and $ whoami on Windows, in the rare case none of the environment variables are set. The result is cached.

username()

Returns a Promise<string> with the username.

username.sync()

Returns the username.

Related

Версии библиотеки

Версия
2.3.0