Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hnaderi/scala-readpass

Cross platform readpassword for scala native and jvm
https://github.com/hnaderi/scala-readpass

cross-platform password scala scala-native scalanative stdin stdin-inputs utility

Last synced: 28 days ago
JSON representation

Cross platform readpassword for scala native and jvm

Awesome Lists containing this project

README

        

## readpassword
[![readpassword Scala version support](https://index.scala-lang.org/hnaderi/scala-readpass/readpassword/latest.svg)](https://index.scala-lang.org/hnaderi/scala-readpass/readpassword)
![Build](https://github.com/hnaderi/scala-readpass/workflows/Continuous%20Integration/badge.svg)
![GitHub](https://img.shields.io/github/license/hnaderi/scala-readpass)

This is a cross platform `readpassword` utility useful for CLIs that require reading password from stdin.
It acts like standard unix style of password input, like in `sudo` where password is hidden on input.

### Usage

This library is currently available for Scala binary versions 2.13 and 3.2 on JVM and Scala native.

To use the latest version, include the following in your `build.sbt`:

```scala
libraryDependencies ++= Seq(
"dev.hnaderi" %%% "readpassword" % ""
)
```

Then use it like:

``` scala
import dev.hnaderi.readpassword

object Main extends App {
val pass = readpassword.read("Enter your password: ")
println(s"Your password is: $pass")
}
```

And then:

``` plain
sbt:root> exampleNative/run
Enter your password:
Your password is: This is my password!
```

### Supports
| env | native | jvm |
|:--------------------:|:------:|:---:|
| linux | ✅ | ✅ |
| macos | ✅ | ✅ |
| posix compliant OSes | ✅ | ✅ |
| windows | ✅ | ✅ |