Function bindFS

  • bindFS(fs: __module): typeof default
  • Generate a new path object, which uses the given fs to perform filesystem operations.

    ⚠️ Warning:

    • Some third-party fs do not fully implement all the features of node:fs. When using the corresponding API, you should check the documentation of the fs you gave.
    • Third-party fs will most likely only support POSIX-style paths, so don't forget to switch to a specific platform before calling bindFS.

    Example

    import { fs } from 'memfs';

    const mpath = path.posix.bindFS(fs);
    mpath('/hello.txt').writeFileSync('World!');

    Parameters

    • fs: __module

    Returns typeof default

Generated using TypeDoc