javascript - Passing an argument through package.json to installation script of npm package dependency -


i have npm package configures 1 of 3 target platforms when being installed (node.js, browser, react-native). or @ least goal, right configures node.js because have not found way give desired information.

the solutions came mind have disadvantage developer adding package dependency has something, example, ask them set environment variable, have done each time installs or updates modules.

what way send parameter installation script of npm module, , parameter ideally in package.json, double-ideally in actual line configures dependency on package.

i found this similar question here on so - has no answer, not single comment.

i checked npm documentation didn't find anything. can think of workarounds outside npm. makes me wonder if i'm doing wrong i'm looking for, or if i'm overlooking something, because seems me should if not common @ least not extremely rare question? can't imagine npm modules configuring different environments through installation script in not 100% automatable ways depend on provided parameter should rare there aren't questions it. yet found none, discussions passing parameters scripts defined in package.json.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -