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

@zenfs/core

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zenfs/core - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

dist/ApiError.d.ts

@@ -1,2 +0,2 @@

/// <reference types="node" />
/// <reference types="node" resolution-mode="require"/>
/**

@@ -3,0 +3,0 @@ * Standard libc error codes. More will be added to this enum and ErrorStrings as they are

@@ -1,6 +0,6 @@

import { type FileSystem, SynchronousFileSystem, FileSystemMetadata } from '../filesystem';
import { File, FileFlag, PreloadFile } from '../file';
import { Stats } from '../stats';
import { Cred } from '../cred';
import { type BackendOptions } from './backend';
import { type FileSystem, SynchronousFileSystem, FileSystemMetadata } from '../filesystem.js';
import { File, FileFlag, PreloadFile } from '../file.js';
import { Stats } from '../stats.js';
import { Cred } from '../cred.js';
import { type BackendOptions } from './backend.js';
export declare namespace AsyncMirror {

@@ -7,0 +7,0 @@ /**

@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

var _a;
import { SynchronousFileSystem } from '../filesystem';
import { ApiError, ErrorCode } from '../ApiError';
import { FileFlag, PreloadFile } from '../file';
import { SynchronousFileSystem } from '../filesystem.js';
import { ApiError, ErrorCode } from '../ApiError.js';
import { FileFlag, PreloadFile } from '../file.js';
import * as path from 'path';
import { Cred } from '../cred';
import { CreateBackend } from './backend';
import { Cred } from '../cred.js';
import { CreateBackend } from './backend.js';
/**

@@ -19,0 +19,0 @@ * We define our own file to interpose on syncSync() for mirroring purposes.

@@ -1,6 +0,6 @@

/// <reference types="node" />
import { Cred } from '../cred';
import { PreloadFile, File, FileFlag } from '../file';
import { BaseFileSystem } from '../filesystem';
import { Stats } from '../stats';
/// <reference types="node" resolution-mode="require"/>
import { Cred } from '../cred.js';
import { PreloadFile, File, FileFlag } from '../file.js';
import { BaseFileSystem } from '../filesystem.js';
import { Stats } from '../stats.js';
/**

@@ -7,0 +7,0 @@ * Represents an *asynchronous* key-value store.

@@ -11,9 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import * as path from 'path';
import { ApiError, ErrorCode } from '../ApiError';
import { W_OK, R_OK } from '../emulation/constants';
import { PreloadFile, FileFlag } from '../file';
import { BaseFileSystem } from '../filesystem';
import Inode from '../inode';
import { FileType } from '../stats';
import { ROOT_NODE_ID, randomUUID, getEmptyDirNode } from '../utils';
import { ApiError, ErrorCode } from '../ApiError.js';
import { W_OK, R_OK } from '../emulation/constants.js';
import { PreloadFile, FileFlag } from '../file.js';
import { BaseFileSystem } from '../filesystem.js';
import Inode from '../inode.js';
import { FileType } from '../stats.js';
import { ROOT_NODE_ID, randomUUID, getEmptyDirNode } from '../utils.js';
class LRUNode {

@@ -20,0 +20,0 @@ constructor(key, value) {

@@ -1,2 +0,2 @@

import type { BFSCallback, FileSystem } from '../filesystem';
import type { BFSCallback, FileSystem } from '../filesystem.js';
/**

@@ -3,0 +3,0 @@ * Describes a file system option.

@@ -1,2 +0,2 @@

import { checkOptions } from '../utils';
import { checkOptions } from '../utils.js';
export function CreateBackend(options, cb) {

@@ -3,0 +3,0 @@ cb = typeof options === 'function' ? options : cb;

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

import { BaseFileSystem, type FileSystem } from '../filesystem';
import { type BackendOptions } from './backend';
import { BaseFileSystem, type FileSystem } from '../filesystem.js';
import { type BackendOptions } from './backend.js';
export declare namespace FolderAdapter {

@@ -4,0 +4,0 @@ /**

@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

var _a;
import { BaseFileSystem } from '../filesystem';
import { BaseFileSystem } from '../filesystem.js';
import * as path from 'path';
import { ApiError } from '../ApiError';
import { Cred } from '../cred';
import { CreateBackend } from './backend';
import { ApiError } from '../ApiError.js';
import { Cred } from '../cred.js';
import { CreateBackend } from './backend.js';
/**

@@ -18,0 +18,0 @@ * The FolderAdapter file system wraps a file system, and scopes all interactions to a subfolder of that file system.

@@ -1,6 +0,6 @@

import { AsyncMirror } from './AsyncMirror';
import { FolderAdapter } from './FolderAdapter';
import { InMemoryFileSystem as InMemory } from './InMemory';
import { OverlayFS } from './OverlayFS';
import { BackendConstructor } from './backend';
import { AsyncMirror } from './AsyncMirror.js';
import { FolderAdapter } from './FolderAdapter.js';
import { InMemoryFileSystem as InMemory } from './InMemory.js';
import { OverlayFS } from './OverlayFS.js';
import { BackendConstructor } from './backend.js';
export declare const backends: {

@@ -7,0 +7,0 @@ [backend: string]: BackendConstructor;

@@ -1,5 +0,5 @@

import { AsyncMirror } from './AsyncMirror';
import { FolderAdapter } from './FolderAdapter';
import { InMemoryFileSystem as InMemory } from './InMemory';
import { OverlayFS } from './OverlayFS';
import { AsyncMirror } from './AsyncMirror.js';
import { FolderAdapter } from './FolderAdapter.js';
import { InMemoryFileSystem as InMemory } from './InMemory.js';
import { OverlayFS } from './OverlayFS.js';
export const backends = {};

@@ -6,0 +6,0 @@ export default backends;

@@ -1,4 +0,4 @@

/// <reference types="node" />
import { SyncKeyValueStore, SimpleSyncStore, SyncKeyValueRWTransaction, SyncKeyValueFileSystem } from './SyncStore';
import { type BackendOptions } from './backend';
/// <reference types="node" resolution-mode="require"/>
import { SyncKeyValueStore, SimpleSyncStore, SyncKeyValueRWTransaction, SyncKeyValueFileSystem } from './SyncStore.js';
import { type BackendOptions } from './backend.js';
/**

@@ -5,0 +5,0 @@ * A simple in-memory key-value store backed by a JavaScript object.

var _a;
import { SimpleSyncRWTransaction, SyncKeyValueFileSystem } from './SyncStore';
import { CreateBackend } from './backend';
import { SimpleSyncRWTransaction, SyncKeyValueFileSystem } from './SyncStore.js';
import { CreateBackend } from './backend.js';
/**

@@ -5,0 +5,0 @@ * A simple in-memory key-value store backed by a JavaScript object.

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

/// <reference types="node" />
import { FileContents, FileSystem, FileSystemMetadata } from '../filesystem';
import { FileFlag } from '../file';
import { Stats } from '../stats';
import { File } from '../file';
import { Cred } from '../cred';
/// <reference types="node" resolution-mode="require"/>
import { FileContents, FileSystem, FileSystemMetadata } from '../filesystem.js';
import { FileFlag } from '../file.js';
import { Stats } from '../stats.js';
import { File } from '../file.js';
import { Cred } from '../cred.js';
/**

@@ -8,0 +8,0 @@ * This class serializes access to an underlying async filesystem.

@@ -10,3 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
import Mutex from '../mutex';
import Mutex from '../mutex.js';
/**

@@ -13,0 +13,0 @@ * This class serializes access to an underlying async filesystem.

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

import { type FileSystem, BaseFileSystem, FileSystemMetadata } from '../filesystem';
import { File, FileFlag, PreloadFile } from '../file';
import { Stats } from '../stats';
import LockedFS from './Locked';
import { Cred } from '../cred';
import { type BackendOptions } from './backend';
import { type FileSystem, BaseFileSystem, FileSystemMetadata } from '../filesystem.js';
import { File, FileFlag, PreloadFile } from '../file.js';
import { Stats } from '../stats.js';
import LockedFS from './Locked.js';
import { Cred } from '../cred.js';
import { type BackendOptions } from './backend.js';
export declare namespace OverlayFS {

@@ -8,0 +8,0 @@ /**

@@ -11,10 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

var _a;
import { BaseFileSystem } from '../filesystem';
import { ApiError, ErrorCode } from '../ApiError';
import { FileFlag, ActionType, PreloadFile } from '../file';
import { Stats } from '../stats';
import LockedFS from './Locked';
import { BaseFileSystem } from '../filesystem.js';
import { ApiError, ErrorCode } from '../ApiError.js';
import { FileFlag, ActionType, PreloadFile } from '../file.js';
import { Stats } from '../stats.js';
import LockedFS from './Locked.js';
import * as path from 'path';
import { Cred } from '../cred';
import { CreateBackend } from './backend';
import { Cred } from '../cred.js';
import { CreateBackend } from './backend.js';
/**

@@ -21,0 +21,0 @@ * @internal

@@ -1,6 +0,6 @@

/// <reference types="node" />
import { Cred } from '../cred';
import { File, FileFlag, PreloadFile } from '../file';
import { SynchronousFileSystem } from '../filesystem';
import { Stats } from '../stats';
/// <reference types="node" resolution-mode="require"/>
import { Cred } from '../cred.js';
import { File, FileFlag, PreloadFile } from '../file.js';
import { SynchronousFileSystem } from '../filesystem.js';
import { Stats } from '../stats.js';
/**

@@ -7,0 +7,0 @@ * Represents a *synchronous* key-value store.

import * as path from 'path';
import { ApiError, ErrorCode } from '../ApiError';
import { W_OK, R_OK } from '../emulation/constants';
import { FileFlag, PreloadFile } from '../file';
import { SynchronousFileSystem } from '../filesystem';
import Inode from '../inode';
import { FileType } from '../stats';
import { randomUUID, getEmptyDirNode, ROOT_NODE_ID } from '../utils';
import { ApiError, ErrorCode } from '../ApiError.js';
import { W_OK, R_OK } from '../emulation/constants.js';
import { FileFlag, PreloadFile } from '../file.js';
import { SynchronousFileSystem } from '../filesystem.js';
import Inode from '../inode.js';
import { FileType } from '../stats.js';
import { randomUUID, getEmptyDirNode, ROOT_NODE_ID } from '../utils.js';
/**

@@ -10,0 +10,0 @@ * A simple RW transaction for simple synchronous key-value stores.

@@ -1,6 +0,6 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import type { FSWatcher, ReadStream, WriteStream, symlink as _symlink } from 'fs';
import { BFSCallback, BFSOneArgCallback, BFSThreeArgCallback, FileContents } from '../filesystem';
import { Stats } from '../stats';
import { BFSCallback, BFSOneArgCallback, BFSThreeArgCallback, FileContents } from '../filesystem.js';
import { Stats } from '../stats.js';
/**

@@ -7,0 +7,0 @@ * Asynchronous rename. No arguments other than a possible exception are given

@@ -1,5 +0,5 @@

import { ApiError, ErrorCode } from '../ApiError';
import { nop, normalizeMode } from './shared';
import * as promises from './promises';
import { R_OK } from './constants';
import { ApiError, ErrorCode } from '../ApiError.js';
import { nop, normalizeMode } from './shared.js';
import * as promises from './promises.js';
import { R_OK } from './constants.js';
/**

@@ -6,0 +6,0 @@ * Asynchronous rename. No arguments other than a possible exception are given

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

/// <reference types="node" />
import * as fs_mock from './index';
/// <reference types="node" resolution-mode="require"/>
import * as fs_mock from './index.js';
import type * as fs_node from 'node:fs';
type ZenFSModule = typeof fs_node & typeof fs_mock;
declare const fs: ZenFSModule;
export * from './index';
export * from './index.js';
export default fs;

@@ -1,5 +0,5 @@

import * as fs_mock from './index';
import * as fs_mock from './index.js';
// @ts-expect-error 2322
const fs = fs_mock;
export * from './index';
export * from './index.js';
export default fs;

@@ -1,5 +0,5 @@

export * from './callbacks';
export * from './sync';
export * as promises from './promises';
export * as constants from './constants';
export { initialize, getMount, getMounts, mount, umount, _toUnixTimestamp } from './shared';
export * from './callbacks.js';
export * from './sync.js';
export * as promises from './promises.js';
export * as constants from './constants.js';
export { initialize, getMount, getMounts, mount, umount, _toUnixTimestamp } from './shared.js';

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

export * from './callbacks';
export * from './sync';
import * as promises_1 from './promises';
export * from './callbacks.js';
export * from './sync.js';
import * as promises_1 from './promises.js';
export { promises_1 as promises };
import * as constants_1 from './constants';
import * as constants_1 from './constants.js';
export { constants_1 as constants };
export { initialize, getMount, getMounts, mount, umount, _toUnixTimestamp } from './shared';
export { initialize, getMount, getMounts, mount, umount, _toUnixTimestamp } from './shared.js';

@@ -1,8 +0,8 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import type { ReadStream, WriteStream, FSWatcher, symlink as _symlink } from 'node:fs';
import * as constants from './constants';
import * as constants from './constants.js';
export { constants };
import { FileContents } from '../filesystem';
import { Stats } from '../stats';
import { FileContents } from '../filesystem.js';
import { Stats } from '../stats.js';
/**

@@ -9,0 +9,0 @@ * Renames a file

@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
import { ApiError, ErrorCode } from '../ApiError';
import * as constants from './constants';
import { ApiError, ErrorCode } from '../ApiError.js';
import * as constants from './constants.js';
export { constants };
import { FileFlag } from '../file';
import { normalizePath, normalizeMode, getFdForFile, normalizeOptions, fd2file, fdMap, normalizeTime, cred, nop, resolveFS, fixError, mounts } from './shared';
import { FileFlag } from '../file.js';
import { normalizePath, normalizeMode, getFdForFile, normalizeOptions, fd2file, fdMap, normalizeTime, cred, nop, resolveFS, fixError, mounts } from './shared.js';
/**

@@ -17,0 +17,0 @@ * Utility for FS ops. It handles

@@ -1,6 +0,6 @@

/// <reference types="node" />
import { Cred } from '../cred';
import { FileSystem } from '../filesystem';
import { File } from '../file';
import { BackendConstructor } from '../backends/backend';
/// <reference types="node" resolution-mode="require"/>
import { Cred } from '../cred.js';
import { FileSystem } from '../filesystem.js';
import { File } from '../file.js';
import { BackendConstructor } from '../backends/backend.js';
/**

@@ -7,0 +7,0 @@ * converts Date or number to a fractional UNIX timestamp

// Utilities and shared data
import { posix as path } from 'path';
import { ApiError, ErrorCode } from '../ApiError';
//import { BackendConstructor } from '../backends';
import { InMemoryFileSystem } from '../backends/InMemory';
import { ApiError, ErrorCode } from '../ApiError.js';
//import { BackendConstructor } from '../backends.js';
import { InMemoryFileSystem } from '../backends/InMemory.js';
/**

@@ -7,0 +7,0 @@ * converts Date or number to a fractional UNIX timestamp

@@ -1,5 +0,5 @@

/// <reference types="node" />
/// <reference types="node" />
import { FileContents } from '../filesystem';
import { Stats } from '../stats';
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import { FileContents } from '../filesystem.js';
import { Stats } from '../stats.js';
import type { symlink, ReadSyncOptions } from 'fs';

@@ -6,0 +6,0 @@ /**

@@ -1,4 +0,4 @@

import { ApiError, ErrorCode } from '../ApiError';
import { FileFlag } from '../file';
import { normalizePath, cred, getFdForFile, normalizeMode, normalizeOptions, fdMap, fd2file, normalizeTime, resolveFS, fixError, mounts } from './shared';
import { ApiError, ErrorCode } from '../ApiError.js';
import { FileFlag } from '../file.js';
import { normalizePath, cred, getFdForFile, normalizeMode, normalizeOptions, fdMap, fd2file, normalizeTime, resolveFS, fixError, mounts } from './shared.js';
function doOp(...[name, resolveSymlinks, path, ...args]) {

@@ -5,0 +5,0 @@ path = normalizePath(path);

@@ -1,4 +0,4 @@

/// <reference types="node" />
import { Stats } from './stats';
import { FileSystem } from './filesystem';
/// <reference types="node" resolution-mode="require"/>
import { Stats } from './stats.js';
import { FileSystem } from './filesystem.js';
export declare enum ActionType {

@@ -5,0 +5,0 @@ NOP = 0,

@@ -10,5 +10,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
import { ApiError, ErrorCode } from './ApiError';
import { Stats } from './stats';
import { getMount } from './emulation/shared';
import { ApiError, ErrorCode } from './ApiError.js';
import { Stats } from './stats.js';
import { getMount } from './emulation/shared.js';
import { Buffer } from 'buffer';

@@ -15,0 +15,0 @@ export var ActionType;

@@ -1,6 +0,6 @@

/// <reference types="node" />
import { ApiError } from './ApiError';
import { Stats } from './stats';
import { File, FileFlag } from './file';
import { Cred } from './cred';
/// <reference types="node" resolution-mode="require"/>
import { ApiError } from './ApiError.js';
import { Stats } from './stats.js';
import { File, FileFlag } from './file.js';
import { Cred } from './cred.js';
export type BFSOneArgCallback = (e?: ApiError) => unknown;

@@ -7,0 +7,0 @@ export type BFSCallback<T> = (e?: ApiError, rv?: T) => unknown;

@@ -13,4 +13,4 @@ /* eslint-disable @typescript-eslint/no-unused-vars */

var _a;
import { ApiError, ErrorCode } from './ApiError';
import { FileFlag, ActionType } from './file';
import { ApiError, ErrorCode } from './ApiError.js';
import { FileFlag, ActionType } from './file.js';
import * as path from 'path';

@@ -17,0 +17,0 @@ import { Buffer } from 'buffer';

/**
* ZenFS's main module. This is exposed in the browser via the ZenFS global.
*/
import fs from './emulation/fs';
import { FileSystem, type BFSOneArgCallback, type BFSCallback } from './filesystem';
import { backends } from './backends';
import fs from './emulation/fs.js';
import { FileSystem, type BFSOneArgCallback, type BFSCallback } from './filesystem.js';
import { backends } from './backends/index.js';
/**

@@ -66,14 +66,14 @@ * Initializes ZenFS with the given file systems.

export declare function getFileSystem(config: FileSystemConfiguration, cb: BFSCallback<FileSystem>): void;
export * from './backends';
export * from './backends/AsyncStore';
export * from './backends/SyncStore';
export * from './ApiError';
export * from './cred';
export * from './file';
export * from './filesystem';
export * from './inode';
export * from './mutex';
export * from './stats';
export * from './utils';
export * from './backends/index.js';
export * from './backends/AsyncStore.js';
export * from './backends/SyncStore.js';
export * from './ApiError.js';
export * from './cred.js';
export * from './file.js';
export * from './filesystem.js';
export * from './inode.js';
export * from './mutex.js';
export * from './stats.js';
export * from './utils.js';
export { fs };
export default fs;

@@ -13,9 +13,9 @@ /**

};
import fs from './emulation/fs';
import { FileSystem } from './filesystem';
import { backends } from './backends';
import { ErrorCode, ApiError } from './ApiError';
import { Cred } from './cred';
import fs from './emulation/fs.js';
import { FileSystem } from './filesystem.js';
import { backends } from './backends/index.js';
import { ErrorCode, ApiError } from './ApiError.js';
import { Cred } from './cred.js';
import * as process from 'process';
import { setCred } from './emulation/shared';
import { setCred } from './emulation/shared.js';
if (process && process['initializeTTYs']) {

@@ -102,14 +102,14 @@ process['initializeTTYs']();

}
export * from './backends';
export * from './backends/AsyncStore';
export * from './backends/SyncStore';
export * from './ApiError';
export * from './cred';
export * from './file';
export * from './filesystem';
export * from './inode';
export * from './mutex';
export * from './stats';
export * from './utils';
export * from './backends/index.js';
export * from './backends/AsyncStore.js';
export * from './backends/SyncStore.js';
export * from './ApiError.js';
export * from './cred.js';
export * from './file.js';
export * from './filesystem.js';
export * from './inode.js';
export * from './mutex.js';
export * from './stats.js';
export * from './utils.js';
export { fs };
export default fs;

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

/// <reference types="node" />
import { Stats } from './stats';
/// <reference types="node" resolution-mode="require"/>
import { Stats } from './stats.js';
/**

@@ -4,0 +4,0 @@ * Generic inode definition that can easily be serialized.

@@ -1,2 +0,2 @@

import { Stats, FileType } from './stats';
import { Stats, FileType } from './stats.js';
import { Buffer } from 'buffer';

@@ -3,0 +3,0 @@ /**

@@ -1,5 +0,5 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import type { StatsBase } from 'fs';
import { Cred } from './cred';
import { Cred } from './cred.js';
/**

@@ -6,0 +6,0 @@ * Indicates the type of the given file. Applied to 'mode'.

@@ -1,4 +0,4 @@

import { Cred } from './cred';
import { Cred } from './cred.js';
import { Buffer } from 'buffer';
import { S_IFDIR, S_IFLNK, S_IFMT, S_IFREG } from './emulation/constants';
import { S_IFDIR, S_IFLNK, S_IFMT, S_IFREG } from './emulation/constants.js';
/**

@@ -5,0 +5,0 @@ * Indicates the type of the given file. Applied to 'mode'.

@@ -1,8 +0,8 @@

/// <reference types="node" />
/// <reference types="node" resolution-mode="require"/>
/**
* Grab bag of utility functions used across the code.
*/
import { FileSystem } from './filesystem';
import { Cred } from './cred';
import type { BaseBackendConstructor } from './backends/backend';
import { FileSystem } from './filesystem.js';
import { Cred } from './cred.js';
import type { BaseBackendConstructor } from './backends/backend.js';
/**

@@ -9,0 +9,0 @@ * Synchronous recursive makedir.

@@ -10,3 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
import { ErrorCode, ApiError } from './ApiError';
import { ErrorCode, ApiError } from './ApiError.js';
import * as path from 'path';

@@ -13,0 +13,0 @@ import { Buffer } from 'buffer';

{
"name": "@zenfs/core",
"version": "0.0.3",
"version": "0.0.4",
"description": "A filesystem in your browser",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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