secure-flow
Advanced tools
Comparing version 1.0.5-beta-4 to 1.0.5-beta-5
@@ -8,2 +8,3 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const child_process_1 = require("child_process"); | ||
const configContent = `module.exports = { | ||
@@ -16,13 +17,29 @@ encryptionAlgorithm: 'aes-256-cbc', | ||
const args = process.argv.slice(2); | ||
let configPath; | ||
if (args.includes('--typescript')) { | ||
configPath = path_1.default.resolve(process.cwd(), 'secureflow.config.ts'); | ||
let configPath = path_1.default.resolve(process.cwd(), 'tsconfig.json'); | ||
if (fs_1.default.existsSync(configPath)) { | ||
(0, child_process_1.exec)('npx create-secureflow-config --typescript', (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`exec error: ${error}`); | ||
return; | ||
} | ||
console.log(`Config created ✅`); | ||
}); | ||
} | ||
else if (args.includes('--javascript')) { | ||
configPath = path_1.default.resolve(process.cwd(), 'secureflow.config.cjs'); | ||
} | ||
else { | ||
console.error('Invalid argument. Use --typescript or --javascript.', args); | ||
process.exit(1); | ||
(0, child_process_1.exec)('npx create-secureflow-config --javascript', (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`exec error: ${error}`); | ||
return; | ||
} | ||
console.log(`Config created ✅`); | ||
}); | ||
} | ||
// if (args.includes('--typescript')) { | ||
// configPath = path.resolve(process.cwd(), 'secureflow.config.ts'); | ||
// } else if (args.includes('--javascript')) { | ||
// configPath = path.resolve(process.cwd(), 'secureflow.config.cjs'); | ||
// } else { | ||
// console.error('Invalid argument. Use --typescript or --javascript.', args); | ||
// process.exit(1); | ||
// } | ||
if (fs_1.default.existsSync(configPath)) { | ||
@@ -29,0 +46,0 @@ console.error(args.includes('--typescript') ? 'secureflow.config.ts already exists in the root directory.' : 'secureflow.config.cjs already exists in the root directory.'); |
@@ -7,3 +7,2 @@ "use strict"; | ||
const config = (0, loadConfig_js_1.loadConfig)(); | ||
// Define return types and parameter types for the functions | ||
function encrypt(text) { | ||
@@ -10,0 +9,0 @@ try { |
{ | ||
"name": "secure-flow", | ||
"version": "1.0.5-beta-4", | ||
"version": "1.0.5-beta-5", | ||
"description": "Secure Flow is a lightweight TypeScript utility package for encryption and decryption using the AES-256-CBC algorithm. This package simplifies the process of securely encrypting and decrypting text, making it easy to integrate strong encryption into your Node.js applications.", | ||
@@ -14,3 +14,4 @@ "main": "dist/index.js", | ||
"build": "tsc", | ||
"create-config": "ts-node src/cli.ts" | ||
"create-config": "ts-node src/cli.ts", | ||
"inq": "ts-node --experimental-specifier-resolution=node src/setup" | ||
}, | ||
@@ -17,0 +18,0 @@ "keywords": [ |
import fs from 'fs'; | ||
import path from 'path'; | ||
import { exec } from "child_process" | ||
@@ -12,11 +13,29 @@ const configContent = `module.exports = { | ||
let configPath: string; | ||
if (args.includes('--typescript')) { | ||
configPath = path.resolve(process.cwd(), 'secureflow.config.ts'); | ||
} else if (args.includes('--javascript')) { | ||
configPath = path.resolve(process.cwd(), 'secureflow.config.cjs'); | ||
let configPath: string = path.resolve(process.cwd(), 'tsconfig.json'); | ||
if (fs.existsSync(configPath)) { | ||
exec('npx create-secureflow-config --typescript', (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`exec error: ${error}`); | ||
return; | ||
} | ||
console.log(`Config created ✅`); | ||
}); | ||
} else { | ||
console.error('Invalid argument. Use --typescript or --javascript.', args); | ||
process.exit(1); | ||
exec('npx create-secureflow-config --javascript', (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`exec error: ${error}`); | ||
return; | ||
} | ||
console.log(`Config created ✅`); | ||
}); | ||
} | ||
// if (args.includes('--typescript')) { | ||
// configPath = path.resolve(process.cwd(), 'secureflow.config.ts'); | ||
// } else if (args.includes('--javascript')) { | ||
// configPath = path.resolve(process.cwd(), 'secureflow.config.cjs'); | ||
// } else { | ||
// console.error('Invalid argument. Use --typescript or --javascript.', args); | ||
// process.exit(1); | ||
// } | ||
@@ -23,0 +42,0 @@ if (fs.existsSync(configPath)) { |
@@ -7,3 +7,2 @@ import { loadConfig } from './loadConfig.js'; | ||
// Define return types and parameter types for the functions | ||
export function encrypt(text: string): string | undefined { | ||
@@ -10,0 +9,0 @@ try { |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
17779
29
386
1