local.settings.json loader for Azure Functions
A zero-dependency process.env
loader for Microsoft Azure's local.settings.json
file
# with npm
npm install localsettings
# or with Yarn
yarn add localsettings
As early as possible in your application, require and configure localsettings
require('localsettings').config()
process.env
now has the keys and values you defined in your local.settings.json
file.
You can use the --require
(-r
) command line option to preload localsettings. By doing this, you do not need to require and load localsettings in your application code. This is the preferred approach when using import
instead of require
.
$ node -r localsettings/config your_script.js