ImportOptions
Defined in: src/draft.ts:67
Options for Draft.import.
Properties
Section titled “Properties”filter?
Section titled “filter?”
readonlyoptionalfilter?: (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.
Parameters
Section titled “Parameters”relativePath
Section titled “relativePath”string
Dirent
Returns
Section titled “Returns”boolean
Example
Section titled “Example”await draft.import('/data/crate', { filter: (_, entry) => entry.name !== '.git' && entry.name !== '.DS_Store' && !entry.name.startsWith('._') && !entry.isSymbolicLink(),});target?
Section titled “target?”
readonlyoptionaltarget?:string
Defined in: src/draft.ts:69
Where in the draft the files go. Leave it out for the top.