{"repo":"bahmutov/as-a","free":true,"listed":false,"github":"https://github.com/bahmutov/as-a","clone":"git clone https://github.com/bahmutov/as-a.git","description":"Runs a given command with additional environment settings for simple local development","language":"JavaScript","stars":67,"topics":["shell","utility","environment","environment-variables"],"license":null,"category":"cli-tools","readme_excerpt":"as-a Runs a given command with additional environment settings for simple local development [![NPM][as-a-icon] ][as-a-url] [![ci status][ci image]][ci url] [![semantic-release][semantic-image] ][semantic-url] as-a = run \"as a\" ... - 📺 Watch Use Utility as-a To Load Multiple Secrets And Pass To Cypress to see how I pass multiple values via environment variables when launching Cypress test runner. - 📺 Watch Inject Entire Objects Into Cypress Tests Using as-a Utility Install npm install --global as-a You can run this tool without installing it npx as-a [section name] [command ...] You can also install this tool locally as a dev dependency. In that case, it will start faster than using npx as-a ... without an install. npm i -D as-a npx as-a [section name] [command ...] Use Create a file in your user's home directory .as-a.ini touch /.as-a.ini Create separate sections for groups of environment settings. For example Now you can run any command (with arguments) and add the section as environment variables. $ npm run env grep why --- nothing ---- $ as-a test npm run env grep why why=just because Recommended to keep private settings for DEV urls, secrets, etc. Multiple profiles You can even use settings from multiple groups of settings using comma-separated list as-a DEV,redis node index.js Current folder A good practice for me was naming a section after the folder name. For example, if the INI file has the following: Then we can inject the variables by running in the folder \"my-ser","default_branch":null,"files":null,"tree":[],"storefront":"/r/bahmutov","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/bahmutov/as-a/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}