@silenteer/natsu-runner
Advanced tools
Comparing version 1.0.3 to 1.0.4
26
index.js
@@ -16,12 +16,4 @@ #!/usr/bin/env node | ||
const envPath = path.join(process.cwd(), '.env.natsu'); | ||
let namespaceConfig; | ||
if (fs.existsSync(envPath)) { | ||
require('dotenv').config({ path: envPath }); | ||
const { NATS_GET_NAMESPACE_SUBJECT, NATS_NAMESPACE_SUBJECTS } = process.env; | ||
if (NATS_GET_NAMESPACE_SUBJECT && NATS_NAMESPACE_SUBJECTS) { | ||
namespaceConfig = { | ||
getNamespaceSubject: NATS_GET_NAMESPACE_SUBJECT, | ||
namespaceSubjects: NATS_NAMESPACE_SUBJECTS, | ||
}; | ||
} | ||
} | ||
@@ -43,12 +35,13 @@ | ||
verbose: options.verbose, | ||
namespace: namespaceConfig, | ||
}); | ||
files.forEach((file) => { | ||
const jsFile = path.join(buildDir, file.replace('.ts', '.js')); | ||
const module = require(jsFile); | ||
async function register() { | ||
for (const file of files) { | ||
const jsFile = path.join(buildDir, file.replace('.ts', '.js')); | ||
const module = require(jsFile); | ||
natsClient.register([module.default]); | ||
console.log('Registered', module.default.subject); | ||
}); | ||
await natsClient.register([module.default]); | ||
console.log('Registered', module.default.subject); | ||
} | ||
} | ||
@@ -59,3 +52,4 @@ async function start() { | ||
start() | ||
register() | ||
.then(() => start()) | ||
.then(() => console.log('Server started successfully')) | ||
@@ -62,0 +56,0 @@ .catch((e) => { |
{ | ||
"name": "@silenteer/natsu-runner", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Nats Unit runner", | ||
@@ -27,4 +27,4 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"@silenteer/natsu": "^1.0.5" | ||
"@silenteer/natsu": "^1.0.16" | ||
} | ||
} |
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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
3
2471
64