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 🙏

© 2024 – Pkg Stats / Ryan Hefner

passmanager-delux

v0.0.5-beta

Published

A simple library for managing and generating passwords in Node.js

Downloads

13

Readme

PassManager

A simple password manager that allows you to generate, save, retrieve, and delete passwords.

Installation

  1. Clone the repository:
git clone https://github.com/your-username/passmanager.git
  1. Install the dependencies:
cd passmanager
npm install

Usage

To use the PassManager class, you can require it in your JavaScript code:

const PassManager = require('./passmanager');

Generating a password

To generate a password of a given length, you can use the generatePassword method:

const pm = new PassManager();
const password = pm.generatePassword(10);
console.log(password);

Saving a password

To save a password with a given name, you can use the savePassword method:

const pm = new PassManager();
await pm.savePassword('example', 'password123');

Retrieving passwords

To retrieve all saved passwords, you can use the getPasswords method:

const pm = new PassManager();
const passwords = pm.getPasswords();
console.log(passwords);

To retrieve a specific password by name, you can use the getPassword method:

const pm = new PassManager();
const password = pm.getPassword('example');
console.log(password);

Deleting a password

To delete a password with a given name, you can use the deletePassword method:

const pm = new PassManager();
await pm.deletePassword('example');

Comparing a password

To compare a plain text password with the hashed password for a given name, you can use the comparePassword method:

const pm = new PassManager();
const isMatch = await pm.comparePassword('example', 'password123');
console.log(isMatch);

Security

The PassManager class uses the bcrypt library to hash passwords before saving them. This ensures that the passwords are stored securely.

However, the getPassword method allows you to retrieve the original, unhashed password. This is not recommended as it poses a security risk. It's generally better to use a secure method to store and retrieve passwords, such as hashing them and comparing the hashed password with the hashed input when authenticating a user.

License

This project is licensed under the MIT License. See the LICENSE file for details.