Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Majo

Index

Constructors

constructor

  • Returns Majo

Properties

Optional baseDir

baseDir: undefined | string

Base directory You normally set this by calling .source

Optional dotFiles

dotFiles: undefined | false | true

meta

meta: object

An object you can use across middleware to share states

Type declaration

  • [k: string]: any

middlewares

middlewares: Middleware[]

Optional onWrite

onWrite: OnWrite

Optional sourcePatterns

sourcePatterns: string[]

Accessors

fileList

fileList:

Get an array of sorted file paths

Methods

dest

  • dest(dest: string, options?: DestOptions): Promise<this>
  • Run middlewares and write processed files to disk

    Parameters

    • dest: string

      Target directory

    • Default value options: DestOptions = {}

    Returns Promise<this>

file

  • file(relativePath: string): File
  • Get a file by relativePath path

    Parameters

    • relativePath: string

      Relative path

    Returns File

fileContents

  • fileContents(relativePath: string): string
  • Get file contents as a UTF-8 string

    Parameters

    • relativePath: string

      Relative path

    Returns string

fileStats

  • fileStats(relativePath: string): Stats
  • Get the fs.Stats object of specified file

    para

    relativePath Relative path

    Parameters

    • relativePath: string

    Returns Stats

filter

  • Filter files

    Parameters

    Returns this

process

  • process(): Promise<this>
  • Process middlewares against files

    Returns Promise<this>

source

  • source(patterns: string | string[], options?: SourceOptions): this
  • Find files from specific directory

    Parameters

    • patterns: string | string[]
    • Default value options: SourceOptions = {}

    Returns this

use

  • Use a middleware

    Parameters

    Returns this

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc