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

86
Vistas
Order of fields in package.json?

Recently I made a PR to a repo to add a typings field in package.json, and the maintainer proposed the following change:

-   "typings": "./src/index.d.ts",
-   "main": "./src/index.js",
-   "exports": "./src/index.js",
+   "main": "./src/index.js",
+   "exports": "./src/index.js",
+   "types": "./src/index.d.ts",

I wonder if there is a recommended rule or convention of orders of entries in package.json.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It could be that the maintainer has a formating tool enabled like prettier that automatically sorts the package.json file. Or maybe they just like ordering their scripts in order of execution. Either way it's a json object so ultimately the order of the fields does not matter, just the nesting.

Another thought is they could be using a special batch or shell script that hand cranks the package.json during CD, converting the scripts object to an array that gets run in order of execution. Without seeing the github I can't be sure though.

https://www.npmjs.com/package/prettier-package-json

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