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

@task-master/task-queue

v2.4.0

Published

Provides solutions for task queue systems

Downloads

22

Readme

@task-master/task-queue

A comprehensive task management module for Node.js

Installation

npm install @task-master/task-queue

Usage

TaskDBRef

Represents a reference to a database.

Constructor

const { TaskDBRef } = require('@task-master/task-queue');

// Example: Creating a reference to a MongoDB database
const dbRef = new TaskDBRef('mongodb://localhost:27017/mydb');

TaskMongoDBRef

Represents a reference to a MongoDB database.

Constructor

const { TaskMongoDBRef } = require('@task-master/task-queue');

// Example: Creating a reference to a MongoDB collection
const mongoDBRef = new TaskMongoDBRef('my_collection');

TaskMongooseRef

Represents a reference to a Mongoose model.

Constructor

const { TaskMongooseRef } = require('@task-master/task-queue');
const mongoose = require('mongoose');

// Example: Creating a reference to a Mongoose model
const MyModel = mongoose.model('MyModel', { name: String });
const mongooseRef = new TaskMongooseRef(MyModel);

TaskBulkDBRef

Represents a reference to a bulk database operation.

Constructor

const { TaskBulkDBRef } = require('@task-master/task-queue');

// Example: Creating a reference to multiple database records
const bulkDBRef = new TaskBulkDBRef(['id1', 'id2', 'id3']);

TaskBulkMongoDBRef

Represents a reference to a bulk MongoDB database operation.

Constructor

const { TaskBulkMongoDBRef } = require('@task-master/task-queue');

// Example: Creating a reference to multiple MongoDB records
const bulkMongoDBRef = new TaskBulkMongoDBRef(['mongodb_id1', 'mongodb_id2']);

TaskStorageRef

Represents a generic storage reference.

Constructor

const { TaskStorageRef } = require('@task-master/task-queue');

// Example: Creating a generic storage reference
const storageRef = new TaskStorageRef(dataObject);

TaskLocalStorageRef

Represents a reference to a local storage.

Constructor

const { TaskLocalStorageRef } = require('@task-master/task-queue');

// Example: Creating a reference to local storage
const localStorageRef = new TaskLocalStorageRef(dataObject, 'container_name');

TaskRemoteStorageRef

Represents a reference to a remote storage.

Constructor

const { TaskRemoteStorageRef } = require('@task-master/task-queue');

// Example: Creating a reference to remote storage
const remoteStorageRef = new TaskRemoteStorageRef(dataObject, 'remote_host');

TaskS3StorageRef

Represents a reference to an Amazon S3 storage.

Constructor

const { TaskS3StorageRef } = require('@task-master/task-queue');

// Example: Creating a reference to Amazon S3 storage
const s3StorageRef = new TaskS3StorageRef(dataObject, 's3_bucket');
s3StorageRef.setRegion('us-east-1');

TaskGCSStorageRef

Represents a reference to Google Cloud Storage (GCS).

Constructor

const { TaskGCSStorageRef } = require('@task-master/task-queue');

// Example: Creating a reference to Google Cloud Storage (GCS)
const gcsStorageRef = new TaskGCSStorageRef(dataObject, 'gcs_bucket');

TaskFTPStorageRef

Represents a reference to FTP storage.

Constructor

const { TaskFTPStorageRef } = require('@task-master/task-queue');

// Example: Creating a reference to FTP storage
const ftpStorageRef = new TaskFTPStorageRef(dataObject, 'ftp_host');
ftpStorageRef.setUsername('username').setPassword('password').setPort(21);

Task

Represents a task in a task management system.

Constructor

const { Task } = require('@task-master/task-queue');

// Example: Creating a task
const task = new Task('task_id');
task.setStatus('in_progress');
task.setPriority(2);

TaskCreator

A class responsible for creating and managing tasks.

Constructor

const { TaskCreator } = require('@task-master/task-queue');

// Example: Creating a task creator
const taskCreator = new TaskCreator({ taskType: 'main', immediate: true });
taskCreator.setSchedule('*/5 * * * *'); // Run every 5 minutes

TaskPayload

Represents the payload for a task.

Constructor

const { TaskPayload } = require('@task-master/task-queue');

// Example: Creating a task payload
const payload = new TaskPayload();
payload.setBody({ message: 'Task payload message' });

TaskWorker

Represents a generic task worker responsible for managing task execution and state.

Constructor

const { TaskWorker } = require('@task-master/task-queue');

// Example: Creating a task worker
const taskWorker = new TaskWorker(task);
taskWorker.setProgress(50); // Set progress to 50%

License

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