open-index/open-npm huggingface dataset:
npm package: @file-services/cached
Description: A file system wrapper that adds cache to any `IFileSystem` implementation.
Latest version: 11.0.1

# @file-services/cached

[![npm version](https://img.shields.io/npm/v/@file-services/cached.svg)](https://www.npmjs.com/package/@file-services/cached)
[![package size](https://img.shields.io/bundlephobia/minzip/@file-services/cached)](https://bundlephobia.com/result?p=@file-services/cached)

A file system wrapper that adds cache to any `IFileSystem` implementation.

## Getting started

Install library in project:

```sh
npm i @file-services/cached
```

Then, use the programmatic API:

```ts
import { nodeFs } from "@file-services/node";
import { createCachedFs } from "@file-services/cached";

const cachedFs = createCachedFs(nodeFs);
cachedFs.writeFileSync("/file.js", "CONTENT");

// calls fs
cachedFs.statSync("/file.js");
// cached
cachedFs.statSync("/file.js");

// clears the cache
cachedFs.invalidate("/file.js");
```

## License

MIT
npm package: @file-services/commonjs
Description: Isomorphic, fs-agnostic implementation of the Node commonjs module system.
Latest version: 11.0.1

# @file-services/commonjs

[![npm version](https://img.shields.io/npm/v/@file-services/commonjs.svg)](https://www.npmjs.com/package/@file-services/commonjs)
[![package size](https://img.shields.io/bundlephobia/minzip/@file-services/commonjs)](https://bundlephobia.com/result?p=@file-services/commonjs)

Isomorphic, fs-agnostic implementation of Node's CommonJS module system.

## Getting started

Install library in project:

```sh
npm i @file-services/commonjs
```

Then, use the programmatic API:

```ts
import { createCjsModuleSystem } from "@file-services/commonjs";
import { createMemoryFs } from "@file-services/memory";

const fs = createMemoryFs({
  "some-folder": {
    "index.js": `module.exports = 'exported value'`,
  },
});

const moduleSystem = createCjsModuleSystem({ fs });

const evaluated = moduleSystem.requireModule("/some-folder/index.js");
// evaluated === 'exported value'
```

## License

MIT
npm package: @file-services/directory
Description: A file system wrapper that adds directory scoping to any `IFileSystem` implementation.
Latest version: 7.2.0

# @file-services/directory

[![npm version](https://img.shields.io/npm/v/@file-services/directory.svg)](https://www.npmjs.com/package/@file-services/directory)
[![package size](https://badgen.net/bundlephobia/minzip/@file-services/directory)](https://bundlephobia.com/result?p=@file-services/directory)

A file system wrapper that adds directory scoping to any `IFileSystem` implementation.

## Getting started

Install library in project:

```sh
npm i @file-services/directory
```

Then, use the programmatic API:

```ts
import { nodeFs } from '@file-services/node';
import { createDirectoryFs } from '@file-services/directory';

const directoryFs = createDirectoryFs(nodeFs, '/path/to/some/folder');

// will be written to /path/to/some/folder/file.js
directoryFs.writeFileSync('/file.js', 'SAMPLE');

// returns 'SAMPLE'
directoryFs.readFileSync('/file.js');
```

## License

MIT
npm package: @file-services/memory
Description: An in-memory, sync/async, file system implementation.
Latest version: 11.0.1

# @file-services/memory

[![npm version](https://img.shields.io/npm/v/@file-services/memory.svg)](https://www.npmjs.com/package/@file-services/memory)
[![package size](https://img.shields.io/bundlephobia/minzip/@file-services/memory)](https://bundlephobia.com/result?p=@file-services/memory)

An in-memory, sync/async, file system implementation.

Contains a subset of node's `fs` API with additional helper functions.

Features:

- Tiny.
- Isomorphic. Works in both Node.js and web-browsers.
- Implements the watch service API (for events).
- Case insensitive.

## Getting started

Install library in project:

```sh
npm i @file-services/memory
```

Then, use the programmatic API:

```ts
import { createMemoryFs } from "@file-services/memory";

const fs = createMemoryFs();

// library uses `posix`-style paths
// and exposes a subset of `fs` API
fs.writeFileSync("/file-in-root", "file contents");

// several helper functions are included
fs.populateDirectorySync("/src", {
  "index.ts": "/* source code */",
  "another-file.ts": "/* more source code */",
});

fs.fileExistsSync("/src/another-file.ts"); // returns true
```

## License

MIT
npm package: @file-services/node
Description: Node.js file system implementation.
Latest version: 11.0.1

# @file-services/node

[![npm version](https://img.shields.io/npm/v/@file-services/node.svg)](https://www.npmjs.com/package/@file-services/node)

Node.js file system implementation, providing a subset of the original `fs` methods,
a watch service, and path methods.
npm package: @file-services/overlay
Description: Overlay files and directories from one file system on top of another.
Latest version: 11.0.1

# @file-services/overlay

Overlay files and directories from one file system on top of another.

## Motivation

Overlay file system allows taking a native node file system ("lower fs") and overlay files and directories from an in-memory file system ("higher fs"). It can be used as a virtual layer providing a solution for storing and manipulating temporary data.

## Behavior

Read operations (`readFile`, `readdir`, `stat`, etc.) are checking higher fs first, and fallback to lower fs.

Currently, all write operations go directly to the original lower fs.

## Getting started

Install library in project:

```sh
npm i @file-services/overlay
```

Then, use the programmatic API:

```ts
import { createOverlayFs } from "@file-services/overlay";
import { createMemoryFs } from "@file-services/memory";
import { nodeFs } from "@file-services/node";

const memFs = createMemoryFs({
  src: {
    "a.txt": `A`,
    "b.txt": `B`,
  },
});

const overlayFs = createOverlayFs(nodeFs /* lower fs */, memFs /* higher fs */);

// overlayFs.readFileSync('src/a.txt', 'utf8') === 'A'
```

`createOverlayFs` also accepts a directory path as third parameter which specifies which directory in lower fs should be overlaid upon (defaults to `lowerFs.cwd()`). This is important when overlaying a memory fs over native node fs and running on Windows. Memory fs uses posix-style paths, so the base directory is where memory's root `/` begins to overlay.

## License

MIT
npm package: @file-services/path
Description: Node's `path` implementation, ready for the web.
Latest version: 11.0.1

# @file-services/path

[![npm version](https://img.shields.io/npm/v/@file-services/path.svg)](https://www.npmjs.com/package/@file-services/path)
[![package size](https://img.shields.io/bundlephobia/minzip/@file-services/path)](https://bundlephobia.com/result?p=@file-services/path)

Node's `path` implementation, ready for the web.

Original code: https://github.com/nodejs/node/blob/main/lib/path.js

## License

MIT
npm package: @file-services/posix-path
Description: Node's posix-`path` implementation converted to TypeScript and ready for the web.
Latest version: 2.1.0

# @file-services/posix-path
[![npm version](https://img.shields.io/npm/v/@file-services/posix-path.svg)](https://www.npmjs.com/package/@file-services/posix-path)
[![package size](https://badgen.net/bundlephobia/minzip/@file-services/posix-path)](https://bundlephobia.com/result?p=@file-services/posix-path)

Node's posix-`path` implementation converted to TypeScript and ready for the web.

Original code: https://github.com/nodejs/node/blob/master/lib/path.js

## Fork changes

- Dropped win32-related functionality.
- Ported to Typescript.
- Separated to files using `esm` imports/exports.
- `resolve` function assumes `cwd` is `/`.
- Removed runtime validation of parameters.
- Fixed shadowed `start` variable in `parse` function.
- Converted loops to `for-const-of`, where possible.
- Changed `var` statements to `const`/`let` statements.
- Applied prettier code formatting.

## License

MIT
npm package: @file-services/resolve
Description: Isomorphic, fs-agnostic implementation of the Node resolution algorithm.
Latest version: 11.0.1

# @file-services/resolve

[![npm version](https://img.shields.io/npm/v/@file-services/resolve.svg)](https://www.npmjs.com/package/@file-services/resolve)
[![package size](https://img.shields.io/bundlephobia/minzip/@file-services/resolve)](https://bundlephobia.com/result?p=@file-services/resolve)

Isomorphic, fs-agnostic implementation of the Node resolution algorithm.

Implements the following behaviors:

- https://nodejs.org/api/modules.html#modules_all_together
- https://github.com/defunctzombie/package-browser-field-spec

## Getting started

Install library in project:

```sh
npm i @file-services/resolve
```

Then, use the programmatic API:

```ts
import { createRequestResolver } from "@file-services/resolve";
import { createMemoryFs } from "@file-services/memory";

const fs = createMemoryFs({
  "some-folder": {
    "index.js": "some content",
  },
});

const resolveRequest = createRequestResolver({ fs });

resolveRequest("/", "./some-folder");
// === '/some-folder/index.js'
```

## License

MIT
npm package: @file-services/test-kit
Description: File system test-kit, containing test contracts.
Latest version: 11.0.1

# @file-services/test-kit

[![npm version](https://img.shields.io/npm/v/@file-services/test-kit.svg)](https://www.npmjs.com/package/@file-services/test-kit)

File system test-kit, containing test contracts.

- asyncBaseFsContract
- syncBaseFsContract
- asyncFsContract
- syncFsContract
npm package: @file-services/types
Description: Common file system interfaces
Latest version: 11.0.1

# @file-services/types

[![npm version](https://img.shields.io/npm/v/@file-services/types.svg)](https://www.npmjs.com/package/@file-services/types)

Common file system interfaces. Used across various `file-services` packages.

- IBaseFileSystem
- IBaseFileSystemSync
- IBaseFileSystemAsync
- IFileSystemStats
- IFileSystem
- IFileSystemSync
- IFileSystemAsync
npm package: @file-services/typescript
Description: Helpers for creation of TypeScript hosts
Latest version: 11.0.1

# @file-services/typescript

[![npm version](https://img.shields.io/npm/v/@file-services/typescript.svg)](https://www.npmjs.com/package/@file-services/typescript)
[![package size](https://img.shields.io/bundlephobia/minzip/@file-services/typescript)](https://bundlephobia.com/result?p=@file-services/typescript)

Helpers for creation of TypeScript hosts.

## Installation

Install library in project:

```sh
npm i @file-services/typescript
```

## API

```ts
/**
 * Create an IBaseHost, which is actually three interfaces combined:
 * - `ts.ParseConfigHost` - for parsing of `tsconfig.json` files
 * - `ts.FormatDiagnosticsHost` - for formatting of `ts.Diagnostic` instances
 * - `ts.ModuleResolutionHost` - for resolution of imports using TypeScript's built-in mechanism
 *
 * @param fs the file system to use as host backend
 */
export function createBaseHost(fs: IFileSystemSync): IBaseHost;

/**
 * Create a TypeScript `LanguageServiceHost` using provided file system.
 *
 * @param fs the file system used as host backend
 * @param baseHost created using `createBaseHost()`
 * @param fileNames list of absolute paths to `.ts/tsx` files included in this transpilation
 * @param compilerOptions compilerOptions to use when transpiling or type checking
 * @param defaultLibsDirectory absolute path to the directory that contains TypeScript's built-in `.d.ts` files
 *                             `path.dirname(ts.getDefaultLibFilePath({}))` in node,
 *                             or custom directory with `@file-services/memory`
 * @param customTransformers optional custom transformers to apply during transpilation
 */
export function createLanguageServiceHost(
  fs: IFileSystemSync,
  baseHost: IBaseHost,
  fileNames: string[],
  compilerOptions: ts.CompilerOptions,
  defaultLibsDirectory: string,
  customTransformers?: ts.CustomTransformers,
): ts.LanguageServiceHost;
```

## License

MIT
npm package: @file-services/utils
Description: Common file system utility functions.
Latest version: 11.0.1

# @file-services/utils

[![npm version](https://img.shields.io/npm/v/@file-services/utils.svg)](https://www.npmjs.com/package/@file-services/utils)
[![package size](https://img.shields.io/bundlephobia/minzip/@file-services/utils)](https://bundlephobia.com/result?p=@file-services/utils)

Common file system utility functions.

# API

- `syncToAsyncFs`: convert a sync-only file system implementation into an async one.

## License

MIT
npm package: @file-services/webpack
Description: Helpers for creation of webpack-compatible file systems.
Latest version: 5.7.1

# @file-services/webpack

[![npm version](https://img.shields.io/npm/v/@file-services/webpack.svg)](https://www.npmjs.com/package/@file-services/webpack)

Helpers for creation of webpack-compatible file systems.

## Installation

Install library in project:

```sh
npm i @file-services/webpack
```

## Usage

```ts
import webpack from 'webpack';
import { nodeFs } from '@file-services/node';
import { createWebpackFs } from '@file-services/webpack';

const compiler = webpack({
  /* webpack config */
});

const webpackFs = createWebpackFs(nodeFs);
compiler.inputFileSystem = webpackFs;
compiler.outputFileSystem = webpackFs;

compiler.run((e, stats) => {
  /* handle bundling result */
});
```

## License

MIT
npm package: @file-share/shared-utils
Description: Shared utilities for file-share project
Author: file-share
Latest version: 1.0.5

# File Share Shared Utils

这是一个为 file-share 项目提供的共享工具库，包含了 Electron 和 uTools 平台都需要使用的通用工具函数。

## 安装

在项目中添加依赖：

```json
{
  "dependencies": {
    "@file-share/shared-utils": "^1.0.0"
  }
}
```


```bash
npm install

# 在 shared 目录下执行
cd shared

# 检查包配置
npm pack --dry-run

# 补丁版本更新 (1.0.0 -> 1.0.1)
npm version patch

# 次要版本更新 (1.0.0 -> 1.1.0)
npm version minor

# 主要版本更新 (1.0.0 -> 2.0.0)
npm version major

# 预发布版本 (1.0.0 -> 1.0.1-0)
npm version prerelease

# 指定具体版本号
npm version 1.0.1

# 发布到 npm
npm publish
```