JSPM

  • Created
  • Published
  • Downloads 720028
  • Score
    100M100P100Q173847F

Bindings to Mac OS X Keychain

Package Exports

  • keytar

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (keytar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

keytar - Keychain Node Module

A native Node module to get, add, replace, and delete passwords in the Mac OS X Keychain.

Installing

npm install keytar

Building

  • Clone the repository
  • Run npm install
  • Run grunt to compile the native and CoffeeScript code
  • Run grunt test to run the specs

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.