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

action-entity

v0.0.1

Published

## Table of Contents

Downloads

3

Readme

Action Entity Documentation

Table of Contents

  1. Introduction
  2. Installation
  3. Getting Started
  4. Supported Operations
  5. Usage
  6. Sample Plugin
  7. Additional Information

Introduction

This documentation provides instructions for using the "Action Entity" class in your JavaScript project. "Action Entity" is a powerful utility for database/resource operations when coupled with a compatible plugin.

Installation

Before using "Action Entity," you need to include it in your project. You can install it via different methods.

Using script src

Include the "Action Entity" library in your HTML file using a <script> tag:

<script src="path/to/actionEntity.js"></script>
<script>
  // To create an instance of Action Entity, you need to provide a compatible plugin.
  // Example plugin initialization
  const plugin = new ActionPlugin();
  const ae = new ActionEntity(plugin);
</script>

Using script type="module

  1. Import the module in your HTML file using a <script type="module"> tag:
<script type="module">
  import ActionEntity from "/path/to/actionEntity.js";
  import ActionPlugin from "/path/to/actionPlugin.js";
  
  // Create an instance of the Action Plugin
  const plugin = new ActionPlugin();

  // Create an instance of Action Entity with the plugin
  const ae = new ActionEntity(plugin);
</script>

Using CommonJS

  1. Require the module in your JavaScript file:
   const ActionEntity = require("action-entity");
   const ActionPlugin = require("action-plugin");
  1. Ensure the plugin is correctly configured and available.
// Create an instance of the Action Plugin
const plugin = new ActionPlugin();

// Create an instance of Action Entity with the plugin
const ae = new ActionEntity(plugin);

Getting Started

Before you can use "Action Entity," you must configure and provide a compatible plugin.

Plugin Configuration

"Action Entity" relies on a plugin for database/resource interaction. Ensure that the plugin is correctly configured and available. You can create an instance of the plugin and pass it to the "Action Entity" constructor, as shown in the usage examples.

Supported Operations

The "Action Entity" class supports various database operations, including:

  • create: Create a new record in the database/resource.
  • insert: Insert data into the database/resource.
  • insertOne: Insert one data item into the database/resource.
  • get: Retrieve data from the database/resource.
  • getOne: Retrieve one data item from the database/resource.
  • update: Update data in the database/resource.
  • updateOne: Update one data item in the database/resource.
  • delete: Delete data from the database/resource.
  • deleteOne: Delete one data item from the database/resource.
  • append: Append data to a resource.

These operations require a correctly configured and available plugin for database/resource interaction. Without the plugin, "Action Entity" will not function as expected.

Usage

Once you have imported the "Action Entity" class and created an instance with a plugin, you can start using it for various database operations. Here are four usage cases:

Case 1: Using script src with Plugin Availability

Include the "Action Entity" library using a <script> tag and ensure the plugin is correctly configured and available.

<script src="path/to/actionEntity.js"></script>
<script src="path/to/actionPlugin.js"></script>
<script>
  // Create an instance of the Action Plugin
  const plugin = new ActionPlugin();
  
  // Create an instance of Action Entity with the plugin
  const ae = new ActionEntity(plugin);
</script>

Case 2: Using script type="module with Plugin Availability

  1. Import the module in your HTML file using a <script type="module"> tag:
<script type="module">
  import ActionEntity from "/path/to/actionEntity.js";
  import ActionPlugin from "/path/to/actionPlugin.js";
  
  // Create an instance of the Action Plugin
  const plugin = new ActionPlugin();

  // Create an instance of Action Entity with the plugin
  const ae = new ActionEntity(plugin);
</script>

Case 3: Using CommonJS with Plugin Availability

  1. Require the module in your JavaScript file:

    const ActionEntity = require("action-entity");
    const ActionPlugin = require("action-plugin");
  2. Ensure the plugin is correctly configured and available.

// Create an instance of the Action Plugin
const plugin = new ActionPlugin();

// Create an instance of Action Entity with the plugin
const ae = new ActionEntity(plugin);

Case 4: Using ESM without Plugin Availability

import ActionEntity from "action-entity";

// Create an 'ae' instance without a plugin
const ae = new ActionEntity();

// The 'ae' instance will not work for database operations without a compatible plugin

Sample Plugin

You can create a custom plugin for your specific database/resource. Below is an example of a simple plugin:

class ActionPlugin {
  constructor() {
    // Your plugin initialization logic here
  }

  // Define your plugin methods for create, insert, get, update, and delete
}

module.exports = ActionPlugin;

Additional Information

For more information and detailed documentation, please refer to the official repository or documentation provided with the "Action Entity" library.

Repository

License

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