@types/file-entry-cache

  • Version 5.0.4
  • Published
  • 5.38 kB
  • 1 dependency
  • MIT license

Install

npm i @types/file-entry-cache
yarn add @types/file-entry-cache
pnpm add @types/file-entry-cache

Overview

TypeScript definitions for file-entry-cache

Index

Functions

function create

create: (
cacheName: string,
directory?: string,
usecheckSum?: boolean
) => FileEntryCache;
  • Parameter cacheName

    the name of the cache to be created

    Parameter directory

    the directory to load the cache from

    Parameter usecheckSum

    Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file

function createFromFile

createFromFile: (pathToCache: string, useCheckSum?: boolean) => FileEntryCache;
  • Parameter pathToCache

    the path to the cache file (this combines the cache name and directory

    Parameter useCheckSum

    Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file

Interfaces

interface AnalyzedFilesInfo

interface AnalyzedFilesInfo {}

    property changedFiles

    readonly changedFiles: string[];

      property notChangedFiles

      readonly notChangedFiles: string[];

        property notFoundFiles

        readonly notFoundFiles: string[];

          interface FileDescriptor

          interface FileDescriptor {}

            property changed

            readonly changed?: boolean | undefined;

              property err

              readonly err?: Error | undefined;

                property key

                readonly key: string;

                  property meta

                  readonly meta?:
                  | {
                  readonly size?: number | undefined;
                  readonly mtime?: number | undefined;
                  readonly hash?: string | undefined;
                  }
                  | undefined;

                    property notFound

                    readonly notFound: boolean;

                      interface FileEntryCache

                      interface FileEntryCache {}

                        property cache

                        cache: object;
                        • the flat cache storage used to persist the metadata of the `files

                        method analyzeFiles

                        analyzeFiles: (files?: string[]) => AnalyzedFilesInfo;
                        • given an array of file paths it return and object with three arrays: - changedFiles: Files that changed since previous run - notChangedFiles: Files that haven't change - notFoundFiles: Files that were not found, probably deleted

                        method deleteCacheFile

                        deleteCacheFile: () => void;
                        • Delete the cache file from the disk

                        method destroy

                        destroy: () => void;
                        • remove the cache from the file and clear the memory cache

                        method getFileDescriptor

                        getFileDescriptor: (file: string) => FileDescriptor;

                          method getHash

                          getHash: (buffer: Buffer) => string;
                          • Given a buffer, calculate md5 hash of its content.

                          method getUpdatedFiles

                          getUpdatedFiles: (files?: string[]) => string[];
                          • Return the list o the files that changed compared against the ones stored in the cache

                          method hasFileChanged

                          hasFileChanged: (file: string) => boolean;
                          • Return whether or not a file has changed since last time reconcile was called

                          method normalizeEntries

                          normalizeEntries: (files?: string[]) => FileDescriptor[];
                          • return the list of file

                          method reconcile

                          reconcile: (noPrune?: boolean) => void;
                          • Sync the files and persist them to the cache

                          method removeEntry

                          removeEntry: (entryName: string) => void;
                          • Remove an entry from the file-entry-cache. Useful to force the file to still be considered modified the next time the process is run

                          Package Files (1)

                          Dependencies (1)

                          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/file-entry-cache.

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