Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@miniflare/scheduler

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miniflare/scheduler - npm Package Compare versions

Comparing version 2.0.0-rc.1 to 2.0.0-rc.2

8

package.json
{
"name": "@miniflare/scheduler",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Scheduler module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers",

@@ -39,9 +39,9 @@ "keywords": [

"dependencies": {
"@miniflare/core": "2.0.0-rc.1",
"@miniflare/shared": "2.0.0-rc.1",
"@miniflare/core": "2.0.0-rc.2",
"@miniflare/shared": "2.0.0-rc.2",
"cron-schedule": "^3.0.4"
},
"devDependencies": {
"@miniflare/shared-test": "2.0.0-rc.1"
"@miniflare/shared-test": "2.0.0-rc.2"
}
}
# `@miniflare/scheduler`
Scheduler module for [Miniflare](https://github.com/cloudflare/miniflare): a
fun, full-featured, fully-local simulator for Cloudflare Workers
fun, full-featured, fully-local simulator for Cloudflare Workers. See
[⏰ Scheduled Events](https://miniflare.dev/scheduled.html) for more details.
## Example
```js
import { CorePlugin, MiniflareCore } from "@miniflare/core";
import { VMScriptRunner } from "@miniflare/runner-vm";
import { Log, LogLevel } from "@miniflare/shared";
import { SchedulerPlugin, startScheduler } from "@miniflare/scheduler";
import { MemoryStorage } from "@miniflare/storage-memory";
export class BadStorageFactory {
storage() {
throw new Error("This example shouldn't need storage!");
}
}
const plugins = { CorePlugin, SchedulerPlugin };
const ctx = {
log: new Log(LogLevel.INFO),
storageFactory: new BadStorageFactory(),
scriptRunner: new VMScriptRunner(),
};
const mf = new MiniflareCore(plugins, ctx, {
modules: true,
script: `export default {
async scheduled(request, env) {
console.log("tick");
}
}`,
crons: ["* * * * *"],
});
const scheduler = await startScheduler(mf); // tick, tick, tick, ...
scheduler.dispose();
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc