Giter Club home page Giter Club logo

nuxt-scheduler's Introduction

Roarify - A JurassicJS package for ferocious string transformations

Brief Description

Roarify is a (purposefully) simple JurassicJS test package designed to help developers understand the process of publishing packages to the Java Shared Repository. It provides a single function to make your strings mighty.

Functionality

  • roar() function:
    • Takes a string as input.
    • Returns the string in uppercase followed by a powerful "ROAR!".

Installation

Usage Example

import { roar } from "jsr:@jurassicjs/roar"; // Import from the JurassicJS organization 

const input = "hello world";
const mightyRoar = roar(input);

nuxt-scheduler's People

Contributors

rohrig avatar thetejasmagade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nuxt-scheduler's Issues

Documentation is not up-to-date

It seems that the module has been recently updated. The interface has changed but the documentation has not been updated.

I am mainly thinking of the commit 19916c5 that changes the run method interface. How should it be used now ? How should I define the string key ? What is it based on ?

Importing useSheduler thwowing an error :

I am using Nuxt Schduler but i keep getting this error.
What might be wrong?

 ERROR  Failed to resolve import "#scheduler" from "plugins/cronScheduler.ts". Does the file exist?

Here is my code

import { useScheduler } from "#scheduler";

export default defineNitroPlugin(() => {
  startScheduler();
});

function startScheduler() {
  const scheduler = useScheduler();

  scheduler
    .run(() => {
      console.log("=====>cool beans! I run once a second! ๐Ÿ˜€");
    })
    .everySeconds(4);

  // create as many tasks as you want here
}

building the project

When I use this package, Nuxt 3 stays here while building.
You can preview this build using node .output/server/index.mjs

and it never exit. This does not allow me to deploy.

Screenshot 2023-12-30 032320

[Feature] Output errors that occur in scheduled callback

I have a few asynchronous functions scheduled with this but they don't work when scheduled vs when run normally within a plugin.

I'm assuming either:

  1. Something is erroring in my code
  2. This library doesn't like scheduling asynchronous functions.

I'm trying to rule out 1, but I can't find a way to get errors to log to the console.
Even this PoC doesn't log the error:

import { useScheduler } from "#scheduler"

export default defineNitroPlugin(async (nitroApp) => {

    const scheduler = useScheduler(); 

    scheduler.run(async () => {
        console.log("Throwing error...")
        throw new Error("test");
    }).everyMinute(); // Every hour between 7am and 7pm
})

Is there any way to get the errors out, or does the library need a change to forward any thrown errors through the library out the other end?
Thanks in advanced for the help :)

Feature Request - Retrieve Next Running Date, Status of Cron Jobs, and Ability to Name Cron Jobs

Hello ๐Ÿ‘‹

I'm not certain if it's currently possible with the node-cron module, but I would like to request a feature that enables retrieving the next running date and status of scheduled cron jobs. Additionally, it would be great to have the ability to name cron jobs for better identification and organization.

The purpose of this functionality is to facilitate the creation of an API endpoint that displays a page showing the status of cron jobs.

While it is feasible to manually store basic job statistics in a database, with nitro storage layer for example, and update them when a job runs, integrating this capability directly into the nuxt-scheduler module would greatly simplify the process and might be useful for someone else

Thank you for considering this feature request!

When prerendering and using nuxt-scheduler, build hangs

Heya!

I'm trying to prerender some routes due to me using a service worker and need some cache-ing, but when I combine running the scheduler + prerendering, the process hangs and yarn build never finishes.

Nuxt version: 3.7.4
Nuxt-scheduler version: 0.1.9

Nuxt config settings:

routeRules: {
  // Static generation
  '/': { prerender: true },
  '/login': { prerender: true },
  '/register': { prerender: true },
  // CDN cache rules
  '/manifest.webmanifest': {
    headers: {
      'Content-Type': 'application/manifest+json',
      'Cache-Control': 'public, max-age=0, must-revalidate',
    },
  },
},

nitro: {
  esbuild: {
    options: {
      target: 'esnext',
    },
  },
  prerender: {
    crawlLinks: true,
    failOnError: false,
  }
},

Run X times

Hello, good work on this, very useful.

I was thinking if is possible to make it run a few times? For example, I only want it to run like 4 to 5 times in an interval of one day or 1 week if success, can be dynamically like that? It's on plans to make an improvement like that without save a temp variable to check how many times the plugin already executed.

Impact of edge deployments when using this module

Hello,

What would happen if you would use the Netlify Edge preset from here?

Will there be a normal server for the function related to this module in addition to the deployed edge functions, or would the scheduled function be deployed multiple times to the edge servers as well?

Why server/app ?

Wondering why this particular path?

Why not using server/schedulers/[name].ts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.