![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
passmanager-delux
Advanced tools
A simple library for managing and generating passwords in Node.js
A simple password manager that allows you to generate, save, retrieve, and delete passwords.
git clone https://github.com/your-username/passmanager.git
cd passmanager
npm install
To use the PassManager class, you can require it in your JavaScript code:
const PassManager = require('./passmanager');
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);
To save a password with a given name, you can use the savePassword
method:
const pm = new PassManager();
await pm.savePassword('example', 'password123');
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);
To delete a password with a given name, you can use the deletePassword
method:
const pm = new PassManager();
await pm.deletePassword('example');
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);
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.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A simple library for managing and generating passwords in Node.js
The npm package passmanager-delux receives a total of 2 weekly downloads. As such, passmanager-delux popularity was classified as not popular.
We found that passmanager-delux demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.