Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
/node-keytarPublic archive

Native Password Node Module

License

NotificationsYou must be signed in to change notification settings

atom/node-keytar

Travis Build StatusWindows Build StatusDependency Status

A native Node module to get, add, replace, and delete passwords in system's keychain. On macOS the passwords are managed by the Keychain, on Linux they are managed by the Secret Service API/libsecret, and on Windows they are managed by Credential Vault.

Installing

npm install keytar

On Linux

Currently this library useslibsecret so you may need to install it before runningnpm install.

Depending on your distribution, you will need to run the following command:

  • Debian/Ubuntu:sudo apt-get install libsecret-1-dev
  • Red Hat-based:sudo yum install libsecret-devel
  • Arch Linux:sudo pacman -S libsecret

Building

  • Clone the repository
  • Runnpm install
  • Runnpm test to run the tests

Supported versions

Each release ofkeytar includes prebuilt binaries for the versions of Node and Electron that are actively supported by these projects. Please refer to the release documentation forNode andElectron to see what is supported currently.

Bindings from other languages

Docs

constkeytar=require('keytar')

Every function in keytar is asynchronous and returns a promise. The promise will be rejected with any error that occurs or will be resolved with the function's "yields" value.

getPassword(service, account)

Get the stored password for theservice andaccount.

service - The string service name.

account - The string account name.

Yields the string password ornull if an entry for the given service and account was not found.

setPassword(service, account, password)

Save thepassword for theservice andaccount to the keychain. Adds a new entry if necessary, or updates an existing entry if one exists.

service - The string service name.

account - The string account name.

password - The string password.

Yields nothing.

deletePassword(service, account)

Delete the stored password for theservice andaccount.

service - The string service name.

account - The string account name.

Yieldstrue if a password was deleted, orfalse if an entry with the given service and account was not found.

findCredentials(service)

Find all accounts and password for theservice in the keychain.

service - The string service name.

Yields an array of{ account: 'foo', password: 'bar' }.

findPassword(service)

Find a password for theservice in the keychain. This is ideal for scenarios where anaccount is not required.

service - The string service name.

Yields the string password, ornull if an entry for the given service was not found.


[8]ページ先頭

©2009-2025 Movatter.jp