Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

220
Views
Why same wildcards behave differently in shell and npm script?

I want use ./src/**/*.js to match every js file in ./src folder,no matter how deep the file path is.

so I run ls ./src/**/*.js in the shell and the wildcards behave as I expected, js files like ./src/path1/a.js ./src/path1/path2/b.js and both matched.

And then I add npm script in package.json

{
  scripts: {
    "test": "ls ./src/**/*.js"
  }
}

run npm run test. But now only files like ./src/pah1/a.js are matched.

I don't know why same wildcards behave differently.Can anyone tell me what is the right wildcards that I can use to match every js files in one folder.

Thank you.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

They're just different. Shells don't expand **. Try find ./src -name '*.js', instead.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!