Skip to content

Sort Files with 'glob.sync' #372

@devalbm

Description

@devalbm

I have some problems to sort the files. Glob.sync order the files alphabetically. Is there any solution to order my way?

   /app
     |__ app.js
     |__ main.js

I have:
glob.sync("./app/*(main|app).js")

I want to include 'main.js' first and later 'app.js', but actually, sync does the opposite. The first file that "match" is app.js due to the alphabetical order.
Any Solution?
Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions