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

@aetheria/common

v1.2.0

Published

Support methods and utilities for Aetheria Headless

Downloads

7

Readme

@aetheria/common

🚀 Welcome to @aetheria/common - the ultimate collection of common methods, utilities, and modules for Aetheria's headless CMS! This package provides a comprehensive set of tools that cover a wide range of functionalities, from generating random strings to validation utilities and much more.

Features

✨ Here are some key features of @aetheria/common:

  • Random string generation: Need a random string of a specific length? Look no further! With the makeRandomString(length) utility, you can easily generate secure random strings to suit your needs.

  • Validation utilities: Simplify your validation process with the validate(value, zod_schema) method. It provides an intuitive way to validate your data against a Zod schema, making data validation a breeze.

  • Bootstrap utilities: The package includes helpful bootstrap utilities to streamline the initialization process of your Aetheria application. These utilities provide a solid foundation for your project's setup and configuration.

  • Decorators: Enhance your NestJS application with the included decorators. The PublicEndpoint(is_public) decorator allows you to define whether an API endpoint should be publicly accessible. The RestUser() decorator provides convenient access to the authenticated user within your controllers.

  • Hashing module: The package includes a simple hashing module that integrates with the HashService provided by NestJS. This module handles bcrypt hashing and verification, ensuring secure password storage for your application.

  • Application models: Find the basic application models, User and Template, along with their related services, NestJS modules, and controllers. These models serve as a solid starting point for building your Aetheria CMS application.

Installation

📦 To install @aetheria/common, simply run the following command:

npm install @aetheria/common

Usage

🔧 Once installed, you can start utilizing the powerful features of @aetheria/common within your Aetheria CMS project or plugin.

Here's an example of how to import and use some of the utilities and modules:

import {
  HashService,
  makeRandomString,
  PublicEndpoint,
  RestUser,
  Template,
  User,
  validate,
  UserDocument
} from "@aetheria/common";

// Generate a random string
const randomString = makeRandomString(10);

// Validate data against a Zod schema
const data = { /* Your data here */};
const schema = { /* Your Zod schema here */};
validate(data, schema);

// Decorators usage
@PublicEndpoint(true)
class MyController {
  getUser(@RestUser() user: UserDocument) {
    // Access the authenticated user
    // ...
  }
}

// Hashing module
const hashService = new HashService();
const hashedPassword = hashService.make("password");
const isValid = hashService.compare("password", hashedPassword);

For detailed documentation, examples, and additional features, please visit the official Aetheria documentation.

Contributing

🤝 We welcome contributions from the community to enhance @aetheria/common. If you have any ideas, bug fixes, or improvements, please feel free to submit a pull request or open an issue on the GitHub repository.

Want some quick links? Here are some useful places to get started:

License

📜 This package is GPL-2.0 licensed.

Get Started Now!

💪 With @aetheria/common, you have access to a powerful set of utilities, modules, and models that will supercharge your Aetheria CMS development. Dive into the extensive documentation, examples, and more by visiting the official Aetheria documentation. Unleash the full potential of your Aetheria CMS projects with ease!

Happy coding! 🎉