Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
react-native-configs
Advanced tools
A module used for setting environment variables based on development or release build for react native
A module similar to npm-config for React Native.
It can be used for setting environment variables based on React Native DEV flag. The DEV variable will be true when running in debug mode.
When the you build your code for release in Xcode or with dev=false as a build param, react-native-config
will look in the root of your project for a config
folder. That folder should contain a debug.json
and
a release.json
file. Inside of each file you can set a json object with whatever environment variable you wish.
Project structure should look like this:
-- My_Project_Root
|
-- config
|
-- debug.json
-- release.json
$ npm install react-nativ-configs
config
directory in the root of your project.When I starting working with React Native, I was wanting a module that I could easily control API urls based on environment.
This module was created in order to achieve that goal. When developing locally, API URLs can be pulled from the debug.json
.
Once you are ready to deploy, the code should be built for release and the variables are nicely swapped out for the release.jsom
.
FAQs
A module used for setting environment variables based on development or release build for react native
We found that react-native-configs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.