cli-spinners | Awesome deno terminal spinners art | Command Line Interface library
kandi X-RAY | cli-spinners Summary
kandi X-RAY | cli-spinners Summary
Awesome deno terminal spinners. This package is inspired from ora and cli-spinners.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cli-spinners
cli-spinners Key Features
cli-spinners Examples and Code Snippets
Community Discussions
Trending Discussions on cli-spinners
QUESTION
I'm migrating one of my CLI tools over to a global installation so that it can be installed globally and used anywhere on my system. Most of my src
files include require('dotenv').config()
at the top of them, but for some reason the env
is undefined now that it's installed globally.
What am I missing?
My package JSON looks like:
...ANSWER
Answered 2021-Jul-07 at 08:40I think it's expected behaviour.
The default path
value for dotenv
is Default: path.resolve(process.cwd(), '.env')
according to the GitHub readme.
Now process.cwd
changes depending upon from where you execute the executable file.
For example if u start node /a/b/c.js
then the cwd would be /a/b
and if you start it from node /a/b/d/c.js
the cwd would be /a/b/d
.
So, in order to get the the .env
file that you want either you have to store the .env
file in a common area like ~/.yourenv
like most other executables do(think .bashrc
).
Or, you can try to get the installation folder and get the .env
file using an absolute path.
For example you can try to import npm
and get the prefix
to find out the installation folder.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cli-spinners
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page