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

smart-task-scheduler

v1.0.5

Published

A smart task scheduler with natural language input

Downloads

330

Readme

Smart Task Scheduler

npm License

The Smart Task Scheduler is an innovative npm package designed to simplify and streamline task scheduling in Node.js projects. Leveraging the power of Natural Language Processing (NLP), it allows you to define tasks using human-friendly, natural language expressions, making task management accessible and intuitive.

Natural Language Scheduling

With Smart Task Scheduler, you can express task schedules in ways that feel natural, eliminating the need for complex configurations. Examples include:

  • "Every Monday at 9 AM": Automate weekly tasks like meetings or reports.
  • "Run after 5 minutes": Quickly execute a task with a simple delay.
  • "On the first day of every month": Perfect for recurring monthly operations, like invoicing or analytics.
  • "At 3 PM every weekend": Automate weekend routines like maintenance checks or updates.

Why Choose Smart Task Scheduler?

This package empowers developers with an intuitive yet powerful solution for managing tasks efficiently. Whether you're working on a personal project or a complex enterprise application, Smart Task Scheduler simplifies workflows with features such as:

  • Task Prioritization: Sort tasks by urgency (high, medium, low).
  • Cross-Timezone Scheduling: Handle global tasks seamlessly.
  • Error-Resilient Design: Avoid mistakes with clear validation and feedback.

Use Cases

The Smart Task Scheduler is a versatile tool suitable for a variety of real-world scenarios:

1. Reminder Applications

Easily build reminder apps by scheduling tasks based on natural language input. For example:

  • "Remind me to call the client every Friday at 3 PM."
  • "Notify me in 30 minutes about my break."

2. Job Automation

Automate repetitive backend processes such as:

  • Generating daily reports.
  • Sending email notifications.
  • Triggering system backups at specific times.

3. Task Management Systems

Efficiently handle task organization by:

  • Scheduling and prioritizing tasks with urgency levels (high, medium, low).
  • Managing recurring tasks, such as weekly check-ins or monthly goals.

4. Workflow Orchestration

Coordinate complex workflows by scheduling interdependent tasks in a specific sequence:

  • Example:
    • Start data processing at 2 AM.
    • Trigger email notifications at 3 AM once processing is complete.
    • Perform database backups at 4 AM.

By combining human-friendly task definitions with robust scheduling features, Smart Task Scheduler is a game-changer for developers who need reliable, scalable task management.


Installation

Install the package using npm:

npm install smart-task-scheduler

Usage

Here’s how you can get started with Smart Scheduler.

Basic Usage

const HumanScheduler = require('smart-task-scheduler');

// Create a new scheduler
const scheduler = new HumanScheduler();

// Schedule a high-priority task
scheduler.scheduleTask("Send email to team", () => {
    console.log("Email sent successfully!");
}, 'high');

// Schedule a low-priority task
scheduler.scheduleTask("Clean temp files", () => {
    console.log("Temporary files cleaned up!");
}, 'low');

// List all scheduled tasks
console.log("Scheduled Tasks:", scheduler.listTasks());

Advanced Features

Delay a Task

You can delay a task by a specific number of minutes:

scheduler.delayTask(0, 15); // Delay task with ID 0 by 15 minutes

Cancel a Task

To cancel a specific task:

scheduler.cancelTask(1); // Cancel task with ID 1

Mark a Task as Completed

You can manually mark a task as completed:

scheduler.markTaskAsCompleted(task);
console.log("Completed Tasks:", scheduler.listCompletedTasks());

View All Scheduled Tasks

List all currently scheduled tasks with their details:

console.log("All Scheduled Tasks:", scheduler.listTasks());

Example Output

Here’s an example of what the output might look like:

Task scheduled: "Send email to team" with priority: high
Task scheduled: "Clean temp files" with priority: low
Scheduled Tasks: [
    { id: 0, description: 'Send email to team', time: '...', status: 'Scheduled', priority: 'high' },
    { id: 1, description: 'Clean temp files', time: '...', status: 'Scheduled', priority: 'low' }
]
Task "Send email to team" completed.
Completed Tasks: [
    { description: 'Send email to team', time: '...', priority: 'high' }
]

Contributing

We welcome contributions! If you'd like to improve this package, feel free to fork the repository and submit a pull request.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Links


Badges

npm License