dfrankland / lastpass-node

🔐 Lastpass client for Node.js
28 stars 10 forks source link

lastpass-node

Lastpass client for Node.js

About

I always see people using other password integrations with Node.js, like 1Password, and that made me sad. I really like Lastpass, but it seems they aren't too dev friendly. This changes that! Now it's extremely easy to access your Lastpass Vault, securely, and with a promised based API.

Getting started

  1. Install and save the package

    npm i -S lastpass
  2. Import the package

    import Lastpass from 'lastpass'; // ES6
    // OR
    var Lastpass = require('lastpass').default; // ES5
  3. Instantiate the class Lastpass

    const lpass = new Lastpass();

Methods

new Lastpass([username])

Parameters:

loadVault(username, password, [twoFactor])

Parameters:

Returns:

loadVaultFile([vaultFile])

Parameters:

Returns:

saveVaultFile([vaultFile, options])

Parameters:

Returns:

getVault()

Parameters:

Returns:

getAccounts(username, password, [search])

Parameters:

Returns:

Credit

This wouldn't be possible without the amazing lastpass-ruby and lastpass-cli.