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

quidproquo-actionprocessor-node

v0.0.237

Published

The `quidproquo-actionprocessor-node` library provides a set of generic action processors for the `quidproquo` framework, allowing you to easily integrate common functionality into your Node.js-based applications.

Downloads

622

Readme

quidproquo-actionprocessor-node

The quidproquo-actionprocessor-node library provides a set of generic action processors for the quidproquo framework, allowing you to easily integrate common functionality into your Node.js-based applications.

Key Features

  1. Comprehensive Action Processors: This library includes a wide range of action processors that cover various common use cases, such as date/time operations, error handling, event processing, GUID generation, logging, math operations, network requests, platform-specific functionality (e.g., delays), and system-level actions.

  2. Extensibility: The action processor architecture is designed to be highly extensible, allowing you to easily add custom action processors to meet your specific requirements.

  3. Dependency Injection: The action processors are integrated with the quidproquo dependency injection system, making it easy to compose and test your application components.

  4. Testability: The action-oriented architecture and asynchronous execution model of quidproquo-actionprocessor-node make it highly testable, with support for unit, integration, and end-to-end testing.

  5. Portability: While the quidproquo-actionprocessor-node library is designed to run on Node.js, the underlying quidproquo-core library is platform-agnostic, allowing you to potentially use these action processors in other environments as well.

Getting Started

To use the quidproquo-actionprocessor-node library, you'll need to install the package and its dependencies. You can do this using your preferred package manager, such as npm or yarn:

npm install quidproquo-actionprocessor-node

Once you have the package installed, you can start using the provided action processors in your quidproquo-based application. The library exports a set of action processors that you can import and use in your code.

Action Processors

The quidproquo-actionprocessor-node library provides the following action processors:

  1. Date/Time Action Processors:
  • DateNowActionProcessor: Retrieves the current date and time as an ISO string.
  1. Error Action Processors:
  • ErrorThrowErrorActionProcessor: Throws a custom error with a specified type, text, and stack trace.
  1. Event Action Processors:
  • (No event-specific action processors are currently implemented)
  1. GUID Action Processors:
  • GuidNewActionProcessor: Generates a new UUID.
  1. Logging Action Processors:
  • LogCreateActionProcessor: Logs a message with a specified log level and optional data.
  1. Math Action Processors:
  • MathRandomNumberActionProcessor: Generates a random number.
  1. Network Action Processors:
  • NetworkRequestActionProcessor: Performs an HTTP request with various options (method, headers, body, etc.).
  1. Platform Action Processors:
  • PlatformDelayActionProcessor: Delays the execution for a specified number of milliseconds.
  1. System Action Processors:
  • SystemBatchActionProcessor: Executes a batch of actions and returns the results.
  1. User Directory Action Processors:
  • (No user directory-specific action processors are currently implemented)

Usage

To use the action processors provided by quidproquo-actionprocessor-node, you can import them into your quidproquo-based application and integrate them with your action processor configuration. Here's an example of how you might use the DateNowActionProcessor:

import { DateNowActionProcessor, actionResult, DateActionType } from 'quidproquo-actionprocessor-node';

const processDateNow: DateNowActionProcessor = async () => {
  return actionResult(new Date().toISOString());
};

export default {
  [DateActionType.Now]: processDateNow,
};

In this example, we define a DateNowActionProcessor function that returns the current date and time as an ISO string. We then export this processor under the DateActionType.Now action type, which can be used in our quidproquo-based application.

Contribution and Development

If you'd like to contribute to the development of quidproquo-actionprocessor-node, please refer to the contributing guidelines for more information.

License

quidproquo-actionprocessor-node is licensed under the MIT License.

Warning: Not for Production

This project is currently under active development and should not be used in production environments. The APIs and functionality are subject to change without notice.