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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@zenova-corp/key

v1.0.4

Published

A secure API key authentication module

Readme

@zenova-corp/key

Welcome to @zenova-corp/key! 🎉 A super handy package for managing your API keys with CockroachDB integration. Whether you want to add, update, or delete API keys, this package will make it a breeze! It even handles missing data gracefully with default values and makes sure your keys are stored securely.

🚀 Features

  • Effortlessly add, update, and delete API keys.
  • Default values for missing fields (0, false, etc.).
  • Smooth integration with CockroachDB for storing your API keys.
  • Works out of the box with .env configuration.
  • Code structure designed with security in mind to keep things safe and sound!

💡 Installation

Ready to get started? Here’s how to install the package in your Node.js project:

  1. Open your terminal and run:

    npm install @zenova-corp/key

    🚀 Boom! You’re all set to use it.

🛠️ Usage

Let’s jump straight into it! Below are some examples to get you going quickly. With @zenova-corp/key, you can easily manage your API keys. Whether it’s adding a new key, updating an existing one, or cleaning up old ones, it’s all at your fingertips.

Add a New API Key

const apiKeyManager = require('@zenova-corp/key');

// Add a brand new API key with all details
apiKeyManager.addApiKey('new-api-key', {
  expiryDate: 'unli',
  remainingRequests: 1000,
  maxRequests: 1000,
  lastAccessDate: '2024-11-20',
});

Update an Existing API Key

// Update an existing API key with new information
apiKeyManager.updateApiKey('existing-api-key', {
  remainingRequests: 500,  // Updated remaining requests
  maxRequests: 500,        // Updated max requests
});

Delete an API Key

// Delete an API key that’s no longer needed
apiKeyManager.deleteApiKey('existing-api-key');

🔑 Methods

Here’s a breakdown of the methods available in the package:

  • addApiKey(apiKey, data): 🌟 Adds a new API key with the provided data. Pass in as much or as little as you like!
  • updateApiKey(apiKey, data): 🔄 Updates an existing API key with the new details. Perfect for when you need to tweak the limits or expiration date.
  • deleteApiKey(apiKey): ❌ Removes an API key from your database.

📝 Configuration

To get your package up and running, you’ll need to set up your CockroachDB configuration in a .env file. Don’t worry, it’s quick and easy!

  1. Create a .env file in the root of your project.
  2. Add the following values for your CockroachDB connection:
COCKROACH_DB_HOST=your-cockroachdb-host
COCKROACH_DB_PORT=26257
COCKROACH_DB_USER=your-db-user
COCKROACH_DB_PASSWORD=your-db-password
COCKROACH_DB_NAME=your-db-name

Once you’ve done that, your API key management is ready to go! 🎉

🎉 License

This package is licensed under the MIT License. Check out the full details in the LICENSE file.

🤝 Contributing

Got an idea or want to improve things? Pull requests and issues are always welcome! 😄 If you want to contribute, just fork this repo, make your changes, and submit a pull request. Let’s make this package even better together! 🎨


✨ Enjoy using @zenova-corp/key to manage your API keys easily and securely! 🚀