npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lastpass

v1.0.3

Published

A Lastpass client for Node.js!

Readme

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.