Skip to main content
Home

latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
23%
Published
9 months ago (0.1.2)

Github Repo

Usage

#!/usr/bin/env bun

// import cron-once from "./mod.js";

Code

mod.js

#!/usr/bin/env bun

import { exit } from "node:process";

let RUNNING = 0;

const { resolve, promise } = Promise.withResolvers();

Deno.cron = async (kind, cron, func) => {
  ++RUNNING;
  try {
    console.log("cron", kind, cron);
    await func();
  } catch (e) {
    console.error(kind, e);
  } finally {
    --RUNNING;
    if (!RUNNING) {
      resolve();
    }
  }
  return;
};

export default async (import_mod) => {
  await import_mod;
  await promise;
  exit();
};

About

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@8v/cron-once

Import symbol

import * as cron_once from "@8v/cron-once";
or

Import directly with a jsr specifier

import * as cron_once from "jsr:@8v/cron-once";

Add Package

pnpm i jsr:@8v/cron-once
or (using pnpm 10.8 or older)
pnpm dlx jsr add @8v/cron-once

Import symbol

import * as cron_once from "@8v/cron-once";

Add Package

yarn add jsr:@8v/cron-once
or (using Yarn 4.8 or older)
yarn dlx jsr add @8v/cron-once

Import symbol

import * as cron_once from "@8v/cron-once";

Add Package

vlt install jsr:@8v/cron-once

Import symbol

import * as cron_once from "@8v/cron-once";

Add Package

npx jsr add @8v/cron-once

Import symbol

import * as cron_once from "@8v/cron-once";

Add Package

bunx jsr add @8v/cron-once

Import symbol

import * as cron_once from "@8v/cron-once";