8 examples of 'npm dotenv' in JavaScript

Every line of 'npm dotenv' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
18function npmGlobalPath() {
19 return shell.exec('npm config get prefix', {silent:true}).output.replace(/\s+$/g, '') + "/lib/node_modules" ;
20}
3function nodeEnv(env) {
4 pi.env({
5 vars: {
6 NODE_ENV: env
7 }
8 });
9}
5function nodeEnv() {
6 if (process.env.NODE_ENV) {
7 return '\'' + process.env.NODE_ENV + '\'';
8 }
9 return '\'development\'';
10}
21get env() { return require('~/helpers/env'); } // eslint-disable-line unicorn/prevent-abbreviations
108function npmProduction(dest, cb) {
109 spawn('npm' + (isWin ? '.cmd' : ''), ['i', '--production'], {
110 cwd: dest,
111 env: Object.create(process.env)
112 }).on('exit', cb)
113}
51env_dev(done) {
52 process.env.NODE_ENV = 'development';
53 done();
54}
135export function npmRun({ dir }: NpmOperationOptions, command: string): Promise {
136 return exec(dir, `npm run ${command}`);
137}
39function npmInstall(cwd) {
40 return run('npm install --production', { cwd }).exec();
41}

Related snippets