Documentation
    Preparing search index...

    Interface AutoSortPackageJsonOptions

    interface AutoSortPackageJsonOptions {
        cwd?: string;
        sortingPreference?: ObjectKeyOrder;
    }

    Hierarchy

    • CwdOption
      • AutoSortPackageJsonOptions
    Index

    Properties

    cwd?: string

    Current working directory

    process.cwd()
    
    sortingPreference?: ObjectKeyOrder

    Define an order of keys that will be applied to the target object The rest of the keys will be ordered in alphabetical order. You can nest ordering by adding an object, that defines a sub-ordering.

    ! All ordering keys are treated as regular expressions, make sure they ! are valid!

    To keep your package.json valid some order rules may be overwritten, like making sure 'types' is always the first entry in 'exports' objects

    By default it orders everything in alphabetical order.

    ['name', '.*', { key: 'scripts', order: ['start', 'build.*'] }, '.*']
    
    []