keytar

Native Password Node Module

View the Project on GitHub atom/node-keytar

keytar - Native Password Node Module

A native Node module to get, add, replace, and delete passwords. On OS X the passwords are managed by the Keychain, and on Windows they are managed by the Credential Vault.

Installing

npm install keytar

Building

Docs

keytar = require 'keytar'

getPassword(service, account)

Get the stored password for the service and account.

service - The string service name.

account - The string account name.

Returns the string password or null on failures.

addPassword(service, account, password)

Add the password for the service and account to the keychain.

service - The string service name.

account - The string account name.

password - The string password.

Returns true on success, false on failure.

deletePassword(service, account)

Delete the stored password for the service and account.

service - The string service name.

account - The string account name.

Returns the string password or null on failures.

replacePassword(service, account, password)

Replace the password for the service and account in the keychain.

This is a simple convenience function that internally calls deletePassword(service, account) followed by addPassword(service, account, password).

service - The string service name.

account - The string account name.

password - The string password.

Returns true on success, false on failure.

findPassword(service)

Find the first password for the service in the keychain.

service - The string service name.

Returns the string password or null on failures.