dotenv-config-cli
Advanced tools
Comparing version 0.1.9 to 0.1.11
@@ -34,3 +34,6 @@ var $bcymd$process = require("process"); | ||
const [key, value] = curr.split("="); | ||
if (key && value) prev[key] = `${key}: process.env.${key}`; | ||
if (key && value) { | ||
const upperCasedKey = key.toUpperCase(); | ||
prev[key] = `${upperCasedKey}: process.env.${upperCasedKey}`; | ||
} | ||
return prev; | ||
@@ -40,4 +43,7 @@ }, {}); | ||
await $82b9cbada0923a3f$var$createConfigFile(configPath); | ||
// If the config path is specified, then we name the file config or index as the default | ||
// path is named config. | ||
const configFileName = configPath === "config" ? "index" : "config"; | ||
let configFile = configPath; | ||
configFile = isTypeScript ? `${configFile}/index.ts` : `${configFile}/index.js`; | ||
configFile = isTypeScript ? `${configFile}/${configFileName}.ts` : `${configFile}/${configFileName}.js`; | ||
try { | ||
@@ -65,3 +71,3 @@ await (0, $bcymd$fspromises.writeFile)(configFile, `export const envConfig = {\n${content}\n};\n`); | ||
name: "configPath", | ||
message: "Specify the path to your configuration file. If not provided, the tool will default to 'config/index.ts' or '.js'. in the root directory.", | ||
message: "Specify the configuration file path. Default location is 'config/index.ts' or '.js' in the root directory. If specified, the file will be 'config.ts' or '.js' in the specified directory.", | ||
initial: "config", | ||
@@ -112,7 +118,7 @@ onState: (0, $75681df33308e0f6$export$5be329c813f660e0), | ||
var $17e2a7c06afd6377$exports = {}; | ||
$17e2a7c06afd6377$exports = JSON.parse('{"name":"dotenv-config-cli","version":"0.1.9","description":"A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.","source":"src/index.ts","main":"lib/main.js","module":"lib/module.js","types":"lib/types.d.ts","files":["lib/**/*","bin/**/*"],"scripts":{"dotenv-config":"ts-node src/index.ts","build":"./scripts/build.sh","link":" npm link ","prepublishOnly":"npm test","test":"jest","prepare":"husky install"},"keywords":[],"author":"Bocar Wane","license":"MIT","repository":{"type":"git","url":"git+https://github.com/bocarw121/dotenv-config-generator.git"},"bin":{"dotenv-config":"./bin/dotenv-config.js"},"homepage":"https://github.com/bocarw121/dotenv-config-generator","devDependencies":{"@parcel/packager-ts":"^2.9.3","@parcel/transformer-typescript-types":"^2.8.3","@types/jest":"^29.5.5","@types/lodash":"^4.14.199","@types/prompts":"^2.4.6","@types/shelljs":"^0.8.13","husky":"^8.0.3","jest":"^29.7.0","parcel":"^2.8.3","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"ansicolor":"^1.1.100","commander":"^11.1.0","lodash":"^4.17.21","prompts":"^2.4.2","shelljs":"^0.8.5"}}'); | ||
$17e2a7c06afd6377$exports = JSON.parse('{"name":"dotenv-config-cli","version":"0.1.12","description":"A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.","source":"src/index.ts","main":"lib/main.js","module":"lib/module.js","types":"lib/types.d.ts","files":["lib/**/*","bin/**/*"],"scripts":{"dotenv-config":"ts-node src/index.ts","build":"./scripts/build.sh","link":" npm link ","prepublishOnly":"npm test","test":"jest","prepare":"husky install"},"keywords":[],"author":"Bocar Wane","license":"MIT","repository":{"type":"git","url":"git+https://github.com/bocarw121/dotenv-config-generator.git"},"bin":{"dotenv-config":"./bin/dotenv-config.js"},"homepage":"https://github.com/bocarw121/dotenv-config-generator","devDependencies":{"@parcel/packager-ts":"^2.9.3","@parcel/transformer-typescript-types":"^2.8.3","@types/jest":"^29.5.5","@types/lodash":"^4.14.199","@types/prompts":"^2.4.6","@types/shelljs":"^0.8.13","husky":"^8.0.3","jest":"^29.7.0","parcel":"^2.8.3","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"ansicolor":"^1.1.100","commander":"^11.1.0","lodash":"^4.17.21","prompts":"^2.4.2","shelljs":"^0.8.5"}}'); | ||
(0, $bcymd$commander.program).name("dotenv-config").description("A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.").version((0, (/*@__PURE__*/$parcel$interopDefault($17e2a7c06afd6377$exports))).version); | ||
(0, $bcymd$commander.program).name("dotenv-config").description("A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript. Note that every time the command is run, the config file will be overwritten.").version((0, (/*@__PURE__*/$parcel$interopDefault($17e2a7c06afd6377$exports))).version); | ||
(0, $bcymd$commander.program).command("generate").description("Reads your .env file and generates a config file.").action(()=>{ | ||
@@ -119,0 +125,0 @@ (0, $82b9cbada0923a3f$export$a6b19750ed7f872e)(); |
@@ -34,3 +34,6 @@ import {argv as $4sKNM$argv, exit as $4sKNM$exit} from "process"; | ||
const [key, value] = curr.split("="); | ||
if (key && value) prev[key] = `${key}: process.env.${key}`; | ||
if (key && value) { | ||
const upperCasedKey = key.toUpperCase(); | ||
prev[key] = `${upperCasedKey}: process.env.${upperCasedKey}`; | ||
} | ||
return prev; | ||
@@ -40,4 +43,7 @@ }, {}); | ||
await $429ab45ec3075d32$var$createConfigFile(configPath); | ||
// If the config path is specified, then we name the file config or index as the default | ||
// path is named config. | ||
const configFileName = configPath === "config" ? "index" : "config"; | ||
let configFile = configPath; | ||
configFile = isTypeScript ? `${configFile}/index.ts` : `${configFile}/index.js`; | ||
configFile = isTypeScript ? `${configFile}/${configFileName}.ts` : `${configFile}/${configFileName}.js`; | ||
try { | ||
@@ -65,3 +71,3 @@ await (0, $4sKNM$writeFile)(configFile, `export const envConfig = {\n${content}\n};\n`); | ||
name: "configPath", | ||
message: "Specify the path to your configuration file. If not provided, the tool will default to 'config/index.ts' or '.js'. in the root directory.", | ||
message: "Specify the configuration file path. Default location is 'config/index.ts' or '.js' in the root directory. If specified, the file will be 'config.ts' or '.js' in the specified directory.", | ||
initial: "config", | ||
@@ -112,7 +118,7 @@ onState: (0, $8b2c2bd1a81cff43$export$5be329c813f660e0), | ||
var $97c14c9239d39cfb$exports = {}; | ||
$97c14c9239d39cfb$exports = JSON.parse('{"name":"dotenv-config-cli","version":"0.1.9","description":"A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.","source":"src/index.ts","main":"lib/main.js","module":"lib/module.js","types":"lib/types.d.ts","files":["lib/**/*","bin/**/*"],"scripts":{"dotenv-config":"ts-node src/index.ts","build":"./scripts/build.sh","link":" npm link ","prepublishOnly":"npm test","test":"jest","prepare":"husky install"},"keywords":[],"author":"Bocar Wane","license":"MIT","repository":{"type":"git","url":"git+https://github.com/bocarw121/dotenv-config-generator.git"},"bin":{"dotenv-config":"./bin/dotenv-config.js"},"homepage":"https://github.com/bocarw121/dotenv-config-generator","devDependencies":{"@parcel/packager-ts":"^2.9.3","@parcel/transformer-typescript-types":"^2.8.3","@types/jest":"^29.5.5","@types/lodash":"^4.14.199","@types/prompts":"^2.4.6","@types/shelljs":"^0.8.13","husky":"^8.0.3","jest":"^29.7.0","parcel":"^2.8.3","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"ansicolor":"^1.1.100","commander":"^11.1.0","lodash":"^4.17.21","prompts":"^2.4.2","shelljs":"^0.8.5"}}'); | ||
$97c14c9239d39cfb$exports = JSON.parse('{"name":"dotenv-config-cli","version":"0.1.12","description":"A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.","source":"src/index.ts","main":"lib/main.js","module":"lib/module.js","types":"lib/types.d.ts","files":["lib/**/*","bin/**/*"],"scripts":{"dotenv-config":"ts-node src/index.ts","build":"./scripts/build.sh","link":" npm link ","prepublishOnly":"npm test","test":"jest","prepare":"husky install"},"keywords":[],"author":"Bocar Wane","license":"MIT","repository":{"type":"git","url":"git+https://github.com/bocarw121/dotenv-config-generator.git"},"bin":{"dotenv-config":"./bin/dotenv-config.js"},"homepage":"https://github.com/bocarw121/dotenv-config-generator","devDependencies":{"@parcel/packager-ts":"^2.9.3","@parcel/transformer-typescript-types":"^2.8.3","@types/jest":"^29.5.5","@types/lodash":"^4.14.199","@types/prompts":"^2.4.6","@types/shelljs":"^0.8.13","husky":"^8.0.3","jest":"^29.7.0","parcel":"^2.8.3","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"ansicolor":"^1.1.100","commander":"^11.1.0","lodash":"^4.17.21","prompts":"^2.4.2","shelljs":"^0.8.5"}}'); | ||
(0, $4sKNM$program).name("dotenv-config").description("A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.").version((0, (/*@__PURE__*/$parcel$interopDefault($97c14c9239d39cfb$exports))).version); | ||
(0, $4sKNM$program).name("dotenv-config").description("A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript. Note that every time the command is run, the config file will be overwritten.").version((0, (/*@__PURE__*/$parcel$interopDefault($97c14c9239d39cfb$exports))).version); | ||
(0, $4sKNM$program).command("generate").description("Reads your .env file and generates a config file.").action(()=>{ | ||
@@ -119,0 +125,0 @@ (0, $429ab45ec3075d32$export$a6b19750ed7f872e)(); |
{ | ||
"name": "dotenv-config-cli", | ||
"version": "0.1.9", | ||
"version": "0.1.12", | ||
"description": "A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.", | ||
@@ -5,0 +5,0 @@ "source": "src/index.ts", |
@@ -26,4 +26,4 @@ # dotenv-config CLI | ||
# There are the prompts you will see | ||
? Path to your .env file. defaults to root .env › .env | ||
? Path to your config file. defaults to config/index.ts or .js › config | ||
? Specify the path to your .env file. The default location is the root directory ('.env'). › .env | ||
? Specify the configuration file path. Default location is 'config/index.ts' or '.js' in the root directory. If specified, the file will be 'config.ts' or '.js' in the specified directory. › config | ||
? Is this a TypeScript project? › (Y/n) | ||
@@ -30,0 +30,0 @@ ``` |
{ | ||
"name": "dotenv-config-cli", | ||
"version": "0.1.9", | ||
"version": "0.1.11", | ||
"description": "A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.", | ||
@@ -16,3 +16,2 @@ "source": "src/index.ts", | ||
"build": "./scripts/build.sh", | ||
"link": " npm link ", | ||
"prepublishOnly": "npm test", | ||
@@ -53,2 +52,2 @@ "test": "jest", | ||
} | ||
} | ||
} |
@@ -26,4 +26,4 @@ # dotenv-config CLI | ||
# There are the prompts you will see | ||
? Path to your .env file. defaults to root .env › .env | ||
? Path to your config file. defaults to config/index.ts or .js › config | ||
? Specify the path to your .env file. The default location is the root directory ('.env'). › .env | ||
? Specify the configuration file path. Default location is 'config/index.ts' or '.js' in the root directory. If specified, the file will be 'config.ts' or '.js' in the specified directory. › config | ||
? Is this a TypeScript project? › (Y/n) | ||
@@ -30,0 +30,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
22808
225