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

cli-package-manager

v1.0.1

Published

A password manager for cli

Downloads

2

Readme

CLI-password-manager

The Password Manager is a Node.js module that allows you to securely manage passwords from the command line interface (CLI). It provides functionalities to add, retrieve, delete, and list passwords for various accounts.

Features

  • Add passwords for different accounts.
  • Retrieve passwords for specific accounts.
  • Delete passwords for accounts.
  • List all stored account names.

Installation

To use the Password Manager, you need to have Node.js and npm installed on your system. You can install the package via npm:

npm install password-manager

Usage

As a Package

1 - Require the package in your Node.js application:

import PasswordManager from 'password-manager';

2 - Set up storage: Choose the type of storage you want to use. The package currently supports the following storage options: LocalFileStorage (JSON file), MongoDBStorage (MongoDB database) and SQL storage.

  • for example, to use LocalFileStorage:
import LocalFileStorage from 'password-manager/storage/local-file-storage';
const storage = new LocalFileStorage('passwords.json');
  • for example, to use MongoDBStorage:
import MongoDBStorage from 'password-manager/storage/mongodb-storage';
const connectionString = 'mongodb://localhost:27017';
const dbName = 'myDatabase';
const collectionName = 'passwords';
const storage = new MongoDBStorage(connectionString, dbName, collectionName);
  • for example, to use SQL storage:
import SQLStorage from 'password-manager/storage/sql-storage';
const connectionString = 'mysql://localhost:3306';
const dbName = 'myDatabase';
const tableName = 'passwords';
const storage = new SQLStorage(connectionString, dbName, tableName);

3 - Create an instance of PasswordManager

const passwordManager = new PasswordManager(storage);

4 - Use the PasswordManager instance to add, retrieve, delete, and list passwords:

  • Add a password:
passwordManager.addPassword('example_name', 'example_password');
  • Retrieve a password:
const password = passwordManager.getPassword('example_name');
  • Delete a password:
passwordManager.deletePassword('example_name');
  • List all passwords:
passwordManager.listPasswords();

5 - Handle errors: Make sure to handle errors appropriately when using password manager methods. Errors might occur due to network issues, storage problems, or validation errors.

As a CLI Tool

You can also use the Password Manager as a CLI tool. After cloning the repository, you can run the following commands in your terminal:

node index.js

and follow the instruction on the teminal

Configuration

The Password Manager can be configured to use different storage options. You can also configure the storage options to use different databases, tables, or collections.

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for more information.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.