yarnpkg/yarn

expose installation context into process

Open

#2.472 aberto em 16 de jan. de 2017

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (2.731 forks)batch import
cat-compatibilitygood first issuetriaged

Métricas do repositório

Stars
 (41.514 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

What is the current behavior?

Greetings!

npm exposes the following process.env.npm_config_global. this enables me to determine what context i am operating in during installation. i do not see such a thing present for yarn.

i understand that this could invoke some fear or questioning.

"why would you ever want or need that? you're probably doing something wrong!" --say concerned citizens

there's actually a plenty valid use case. my use case is that I have a package who's objective is to modify the consumer's package oninstall. because this pkg ships as a dep in other packages, some of which get installed globally, i care to detect this condition and respond accordingly.

Please mention your node.js, yarn and operating system version.

  • node 7.4.0
  • yarn 0.18.1

Guia do colaborador