GitXplorerGitXplorer
d

lastpass-node

public
28 stars
10 forks
14 issues

Commits

List of commits on branch master.
Unverified
aef525a0381d01aa65e542ce83a2491a65c13a37

1.0.3

ddfrankland committed 7 years ago
Unverified
f77299ef0b66b14741eae1a8d04e52cb61692c9b

Add package-lock.json

ddfrankland committed 7 years ago
Verified
2876246752d28f0866d6bf6b6d3e7dad73d43367

Merge pull request #6 from AndreiSoroka/patch-1

ddfrankland committed 7 years ago
Verified
14ced29d3f84753d6df73b74bc03cdd8d3d5fd3f

remove auto padding in decryptData.js "fixes #1"

AAndreiSoroka committed 7 years ago
Unverified
7f1d429a3b4138d61be26afeb5ffe1782972a187

1.0.2

ddfrankland committed 8 years ago
Unverified
a036088d897504f274685df0ca178d3902e8a084

Fix dependencies

ddfrankland committed 8 years ago

README

The README file for this repository.

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:

  • username: Lastpass account username (probably an email) used to set the account from which to load a vault blob file (if it exists);

    • Type: string
    • Required: false

loadVault(username, password, [twoFactor])

Parameters:

  • username: Lastpass account username (probably an email)

    • Type: string
    • Required: true
  • password: Lastpass account password

    • Type: string
    • Required: true
  • twoFactor: Two factor authentication pin (if it's needed and none is provided an error will be thrown)

    • Type: string
    • Required: false

Returns:

  • Promise: resolves to undefined

loadVaultFile([vaultFile])

Parameters:

  • vaultFile: Absolute path to location of a stored vault blob. Defaults to ~/.lastpass-vault-${USERNAME} if a username is set, otherwise to ~/.lastpass-vault.

    • Type: string
    • Required: false

Returns:

  • Promise: resolves to undefined

saveVaultFile([vaultFile, options])

Parameters:

  • vaultFile: Absolute path to store a vault blob file. Defaults to ~/.lastpass-vault-${USERNAME} if a username is set, otherwise to ~/.lastpass-vault.

    • Type: string
    • Required: false
  • options: File options for saving the file. Defaults to { encoding: 'binary', mode: 0o400 } for safe keeping.

    • Type: object
    • Required: false

Returns:

  • Promise: resolves to undefined

getVault()

Parameters:

  • none

Returns:

  • Buffer: encrypted contents of the vault blob from Lastpass

getAccounts(username, password, [search])

Parameters:

  • username: Lastpass account username (probably an email)

    • Type: string
    • Required: true
  • password: Lastpass account password

    • Type: string
    • Required: true
  • search: Object containing a keyword to search for and options for fuzzaldrin. If a this object isn't provided, or a keyword isn't set all accounts will be returned. The options object defaults to { key: 'name' }.

    • Type: object
    • Required: false

Returns:

  • Promise: resolves to an Array of matched accounts

Credit

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