Skip to content

ImportOptions

Defined in: src/draft.ts:67

Options for Draft.import.

readonly optional filter?: (relativePath, entry) => boolean

Defined in: src/draft.ts:81

Called for each entry below a directory source, with its path relative to source using /, such as sub/.DS_Store. Return false to leave the entry out; a directory left out is not read. Not called when source is a file.

string

Dirent

boolean

await draft.import('/data/crate', {
filter: (_, entry) => entry.name !== '.git' && entry.name !== '.DS_Store' && !entry.name.startsWith('._') && !entry.isSymbolicLink(),
});

readonly optional target?: string

Defined in: src/draft.ts:69

Where in the draft the files go. Leave it out for the top.