Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

passmanager-delux

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passmanager-delux

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

  • 0.0.5-beta
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
0
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 13 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc