Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

230
Vistas
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 Respuestas
Responde la pregunta

0

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

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda