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

@miniflare/core

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/core - npm Package Compare versions

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

2

dist/src/index.d.ts

@@ -483,3 +483,3 @@ /// <reference types="node" />

#private;
static redirect(url: string | URL_2, status: ResponseRedirectStatus): Response_2;
static redirect(url: string | URL_2, status?: ResponseRedirectStatus): Response_2;
[kWaitUntil]?: Promise<WaitUntil>;

@@ -486,0 +486,0 @@ constructor(body?: BodyInit_2, init?: ResponseInit_2 | Response_2 | Response_3);

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

@@ -43,3 +43,3 @@ "keywords": [

"@iarna/toml": "^2.2.5",
"@miniflare/shared": "2.0.0-rc.1",
"@miniflare/shared": "2.0.0-rc.2",
"busboy": "^0.3.1",

@@ -49,8 +49,8 @@ "dotenv": "^10.0.0",

"set-cookie-parser": "^2.4.8",
"undici": "^4.9.3"
"undici": "^4.10.2"
},
"devDependencies": {
"@miniflare/shared-test": "2.0.0-rc.1",
"@miniflare/watcher": "2.0.0-rc.1",
"@miniflare/web-sockets": "2.0.0-rc.1",
"@miniflare/shared-test": "2.0.0-rc.2",
"@miniflare/watcher": "2.0.0-rc.2",
"@miniflare/web-sockets": "2.0.0-rc.2",
"@types/busboy": "^0.3.1",

@@ -61,3 +61,3 @@ "@types/set-cookie-parser": "^2.4.1",

"peerDependencies": {
"@miniflare/watcher": "2.0.0-rc.1"
"@miniflare/watcher": "2.0.0-rc.2"
},

@@ -64,0 +64,0 @@ "peerDependenciesMeta": {

# `@miniflare/core`
Core module for [Miniflare](https://github.com/cloudflare/miniflare): a fun,
full-featured, fully-local simulator for Cloudflare Workers
full-featured, fully-local simulator for Cloudflare Workers. See
[🧰 Using the API](https://miniflare.dev/api.html) for more details.
## Example
```js
import { CorePlugin, MiniflareCore } from "@miniflare/core";
import { KVPlugin } from "@miniflare/kv";
import { VMScriptRunner } from "@miniflare/runner-vm";
import { Log, LogLevel } from "@miniflare/shared";
import { MemoryStorage } from "@miniflare/storage-memory";
export class StorageFactory {
storages = new Map();
storage(namespace) {
let storage = this.storages.get(namespace);
if (storage) return storage;
this.storages.set(namespace, (storage = new MemoryStorage()));
return storage;
}
}
const plugins = { CorePlugin, KVPlugin };
const ctx = {
log: new Log(LogLevel.INFO),
storageFactory: new StorageFactory(),
scriptRunner: new VMScriptRunner(),
};
const mf = new MiniflareCore(plugins, ctx, {
modules: true,
script: `export default {
async fetch(request, env) {
return new Response(await env.TEST_NAMESPACE.get("key"));
}
}`,
kvNamespaces: ["TEST_NAMESPACE"],
});
const { TEST_NAMESPACE } = await mf.getBindings();
await TEST_NAMESPACE.put("key", "value");
const res = await mf.dispatchFetch("http://localhost");
console.log(await res.text()); // value
```

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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