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

@miniflare/shared

Package Overview
Dependencies
Maintainers
4
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miniflare/shared - npm Package Compare versions

Comparing version 2.9.0-next.1 to 2.9.0

25

dist/src/index.d.ts

@@ -0,3 +1,7 @@

/// <reference types="node" />
import { Awaitable as Awaitable_2 } from '@miniflare/shared';
import { MockAgent } from 'undici';
import type { Database as SqliteDB } from 'better-sqlite3';
import type { Options as SqliteOptions } from 'better-sqlite3';

@@ -57,2 +61,8 @@ export declare function addAll<T>(set: Set<T>, values: Iterable<T>): void;

export declare function createSQLiteDB(dbPath: string): Promise<SqliteDB>;
export declare interface DBConstructor {
new (filename: string | Buffer, options?: SqliteOptions): SqliteDB;
}
export declare const defaultClock: Clock;

@@ -68,2 +78,4 @@

export declare function getSQLiteNativeBindingLocation(sqliteResolvePath: string): string;
export declare function globsToMatcher(globs?: string[]): Matcher;

@@ -415,2 +427,6 @@

export { SqliteDB }
export { SqliteOptions }
/**

@@ -432,2 +448,3 @@ * Common class for key-value storage:

abstract list(options: StorageListOptions, skipMetadata: true): Awaitable<StorageListResult<StoredKey>>;
getSqliteDatabase(): Promise<SqliteDB>;
hasMany(keys: string[]): Promise<number>;

@@ -441,3 +458,3 @@ getMany<Meta = unknown>(keys: string[], skipMetadata?: false): Promise<(StoredValueMeta<Meta> | undefined)[]>;

export declare interface StorageFactory {
storage(namespace: string, persist?: boolean | string): Awaitable<Storage>;
storage(namespace: string, persist?: boolean | string): Storage;
dispose?(): Awaitable<void>;

@@ -582,2 +599,7 @@ }

}[];
d1_databases?: {
binding: string;
database_name: string;
database_id: string;
}[];
r2_buckets?: {

@@ -630,2 +652,3 @@ binding: string;

kv_persist?: boolean | string;
d1_persist?: boolean | string;
r2_persist?: boolean | string;

@@ -632,0 +655,0 @@ cache?: boolean;

@@ -52,4 +52,6 @@ var __create = Object.create;

base64Encode: () => base64Encode,
createSQLiteDB: () => createSQLiteDB,
defaultClock: () => defaultClock,
getRequestContext: () => getRequestContext,
getSQLiteNativeBindingLocation: () => getSQLiteNativeBindingLocation,
globsToMatcher: () => globsToMatcher,

@@ -572,2 +574,5 @@ kGetConsumer: () => kGetConsumer,

var Storage = class {
async getSqliteDatabase() {
throw new Error("D1 not implemented for this Storage class");
}
async hasMany(keys) {

@@ -606,2 +611,3 @@ const results = keys.map(this.has.bind(this));

var import_async_hooks2 = __toModule(require("async_hooks"));
var import_timers = __toModule(require("timers"));
var import_promises = __toModule(require("timers/promises"));

@@ -657,3 +663,3 @@ var inputGateStorage = new import_async_hooks2.AsyncLocalStorage();

} finally {
setImmediate(this.#unlock);
(0, import_timers.setImmediate)(this.#unlock);
}

@@ -740,2 +746,15 @@ }

};
// packages/shared/src/sqlite.ts
var import_node_path = __toModule(require("node:path"));
async function createSQLiteDB(dbPath) {
const { npxImport, npxResolve } = await import("npx-import");
const { default: DatabaseConstructor } = await npxImport("better-sqlite3@7.6.2");
return new DatabaseConstructor(dbPath, {
nativeBinding: getSQLiteNativeBindingLocation(npxResolve("better-sqlite3"))
});
}
function getSQLiteNativeBindingLocation(sqliteResolvePath) {
return import_node_path.default.resolve(import_node_path.default.dirname(sqliteResolvePath), "../build/Release/better_sqlite3.node");
}
// Annotate the CommonJS export names for ESM import in node:

@@ -768,4 +787,6 @@ 0 && (module.exports = {

base64Encode,
createSQLiteDB,
defaultClock,
getRequestContext,
getSQLiteNativeBindingLocation,
globsToMatcher,

@@ -772,0 +793,0 @@ kGetConsumer,

6

package.json
{
"name": "@miniflare/shared",
"version": "2.9.0-next.1",
"version": "2.9.0",
"description": "Shared utility module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers",

@@ -38,9 +38,11 @@ "keywords": [

"dependencies": {
"@types/better-sqlite3": "^7.6.0",
"kleur": "^4.1.4",
"npx-import": "^1.1.3",
"picomatch": "^2.3.1"
},
"devDependencies": {
"@miniflare/shared-test": "2.9.0-next.1",
"@miniflare/shared-test": "2.9.0",
"@types/picomatch": "^2.3.0"
}
}

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