UNPKG

just-scripts

Version:
71 lines 2.47 kB
import { TaskFunction } from 'just-task'; export interface EntryHeader { name: string; size: number; /** entry mode. defaults to to 0755 for dirs and 0644 otherwise */ mode: number; /** last modified date for entry. defaults to now. */ mtime: Date; /** type of entry. defaults to "file". */ type: 'file' | 'link' | 'symlink' | 'directory' | 'block-device' | 'character-device' | 'fifo' | 'contiguous-file'; /** linked file name */ linkname: string; uid: number; gid: number; uname: string; gname: string; devmajor: number; devminor: number; } export interface CreateOptions { /** output file */ file: string; /** whether to gzip or not, either a boolean or uses the `zlib.Gzip` options like level, memLevel */ gzip?: boolean | { level?: number; memLevel?: number; }; /** the context path of the tar pack */ cwd?: string; /** filter (ignore) entries */ filter?: (path: string, header: EntryHeader) => boolean; /** change the header in the entry (e.g. to replace prefix) */ map?: (header: EntryHeader) => EntryHeader; /** whether to dereference links */ dereference?: boolean; /** specify a set of entries to be packed */ entries?: string[]; } /** * Creates an tar (optionally gzipped) archive * @param options */ export declare function createTarTask(options?: CreateOptions): TaskFunction; export interface ExtractOptions { /** output file */ file: string; /** whether to gzip or not, either a boolean or uses the `zlib.Gzip` options like level, memLevel */ gzip?: boolean; /** the context path of the tar pack */ cwd?: string; /** filter (ignore) entries */ filter?: (path: string, header: EntryHeader) => boolean; /** change the header in the entry (e.g. to replace prefix) */ map?: (header: EntryHeader) => EntryHeader; /** mode for files (e.g. `parseInt(755, 8)`)*/ fmode?: number; /** mode for directories (e.g. `parseInt(755, 8)`) */ dmode?: number; /** set whether all files and dirs are readable */ readable?: boolean; /** set whether all files and dirs are writable */ writable?: boolean; /** whether to dereference links */ dereference?: boolean; } /** * Creates an tar (optionally gzipped) archive * @param options */ export declare function extractTarTask(options?: ExtractOptions): TaskFunction; //# sourceMappingURL=tarTask.d.ts.map