@types/vinyl-fs

  • Version 2.4.12
  • Published
  • 11.1 kB
  • 3 dependencies
  • MIT license

Install

npm i @types/vinyl-fs
yarn add @types/vinyl-fs
pnpm add @types/vinyl-fs

Overview

TypeScript definitions for vinyl-fs

Index

Functions

function dest

dest: {
(folder: string, opt?: DestOptions): any;
(getFolderPath: (file: any) => string): any;
};
  • On write the stream will save the vinyl File to disk at the folder/cwd specified. After writing the file to disk, it will be emitted from the stream so you can keep piping these around. The file will be modified after being written to this stream: cwd, base, and path will be overwritten to match the folder stat.mode will be overwritten if you used a mode parameter contents will have it's position reset to the beginning if it is a stream

    Parameter folder

    destination folder

  • On write the stream will save the vinyl File to disk at the folder/cwd specified. After writing the file to disk, it will be emitted from the stream so you can keep piping these around. The file will be modified after being written to this stream: cwd, base, and path will be overwritten to match the folder stat.mode will be overwritten if you used a mode parameter contents will have it's position reset to the beginning if it is a stream

    Parameter getFolderPath

    function that takes in a file and returns a folder path

function src

src: (globs: string | string[], opt?: SrcOptions) => any;
  • Gets files that match the glob and converts them into the vinyl format

    Parameter globs

    Takes a glob string or an array of glob strings as the first argument Globs are executed in order, so negations should follow positive globs fs.src(['!b*.js', '*.js']) would not exclude any files, but this would: fs.src(['*.js', '!b*.js'])

    Parameter opt

    Options Vinyl source options, changes the way the files are read, found, or stored in the vinyl stream

symlink: {
(
folder: string,
opts?: {
cwd?: string | undefined;
mode?: number | string | undefined;
dirMode?: number | undefined;
}
): any;
(
getFolderPath: (File: any) => string,
opts?: { cwd?: string; dirMode?: number }
): any;
};
  • On write the stream will create a symbolic link (i.e. symlink) on disk at the folder/cwd specified. After creating the symbolic link, it will be emitted from the stream so you can keep piping these around. The file will be modified after being written to this stream: cwd, base, and path will be overwritten to match the folder

  • On write the stream will create a symbolic link (i.e. symlink) on disk at the folder/cwd generated from getFolderPath. After creating the symbolic link, it will be emitted from the stream so you can keep piping these around. The file will be modified after being written to this stream: cwd, base, and path will be overwritten to match the folder

Interfaces

interface DestOptions

interface DestOptions {}

    property cwd

    cwd?: string | undefined;
    • Specify the working directory the folder is relative to Default is process.cwd()

    property dirMode

    dirMode?: number | string | undefined;
    • Specify the mode the directory should be created with. Default is the process mode

    property mode

    mode?: number | string | undefined;
    • Specify the mode the files should be created with Default is the mode of the input file (file.stat.mode) or the process mode if the input file has no mode property

    property overwrite

    overwrite?: boolean | undefined;
    • Specify if existing files with the same path should be overwritten or not. Default is true, to always overwrite existing files

    relativeSymlinks?: boolean | undefined;
    • When creating a symlink, whether or not the created symlink should be relative. If false, the symlink will be absolute. Note: This option will be ignored if a junction is being created.

    property sourcemaps

    sourcemaps?: true | string | undefined;
    • Enables sourcemap support on files passed through the stream. Will write inline soucemaps if specified as true. Specifying a string path will write external sourcemaps at the given path.

    property useJunctions

    useJunctions?: boolean | undefined;

      interface SrcOptions

      interface SrcOptions extends globStream.Options {}

        property allowEmpty

        allowEmpty?: boolean | undefined;
        • Prevents stream from emitting an error when file not found.

        property base

        base?: string | undefined;
        • Specifies the folder relative to the cwd This is used to determine the file names when saving in .dest() Default: where the glob begins

        property buffer

        buffer?: boolean | undefined;
        • Setting this to false will make file.contents a paused stream If true it will buffer the file contents Default: true

        property cwd

        cwd?: string | undefined;
        • Specifies the working directory the folder is relative to

        property dirMode

        dirMode?: number | undefined;
        • The mode the directory should be created with. Default: the process mode

        property dot

        dot?: boolean | undefined;
        • Whether or not you want globs to match on dot files or not (e.g., .gitignore).

        followSymlinks?: boolean | undefined;
        • Whether or not to recursively resolve symlinks to their targets. Setting to false to preserve them as symlinks and make file.symlink equal the original symlink's target path. Default: true

        property passthrough

        passthrough?: boolean | undefined;
        • Setting this to true will create a duplex stream, one that passes through items and emits globbed files. Default: false

        property read

        read?: boolean | undefined;
        • Setting this to false will ignore the contents of the file and disable writing to disk to speed up operations Default: true

        property relative

        relative?: boolean | undefined;
        • Whether or not the symlink should be relative or absolute. Default: false

        property removeBOM

        removeBOM?: boolean | undefined;
        • Causes the BOM to be removed on UTF-8 encoded files. Set to false if you need the BOM for some reason. Default: true

        resolveSymlinks?: boolean | undefined;
        • Whether or not to recursively resolve symlinks to their targets. Setting to false to preserve them as symlinks and make file.symlink equal the original symlink's target path. Default: false

        property since

        since?: Date | number | undefined;
        • Only find files that have been modified since the time specified

        property sourcemaps

        sourcemaps?: boolean | undefined;
        • Setting this to true will enable sourcemaps. Default: false

        property stripBOM

        stripBOM?: boolean | undefined;
        • Causes the BOM to be stripped on UTF-8 encoded files. Set to false if you need the BOM for some reason.

        Namespaces

        namespace global

        namespace global {}

          namespace global.NodeJS

          namespace global.NodeJS {}

            interface WritableStream

            interface WritableStream {}

              method write

              write: (buffer: any, cb?: (err?: Error | null) => void) => boolean;

                Package Files (1)

                Dependencies (3)

                Dev Dependencies (0)

                No dev dependencies.

                Peer Dependencies (0)

                No peer dependencies.

                Badge

                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/vinyl-fs.

                • Markdown
                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/vinyl-fs)
                • HTML
                  <a href="https://www.jsdocs.io/package/@types/vinyl-fs"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>