Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-verse.db

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-verse.db - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

bin/cli.js

100

index.js
#!/usr/bin/env node
const inquirer = require("inquirer");
const fs = require("fs");
const path = require("path");
const { logSuccess, logError, logInfo } = require("../dist/core/logger");
inquirer
.prompt([
{
type: "input",
name: "connectionName",
message: "What is the database connection name?",
validate: function (input) {
const regex = /\s/;
if (regex.test(input)) {
return "Please enter a name without spaces.";
}
return true;
},
},
{
type: "list",
name: "adapter",
message: "What is the database Adapter?",
choices: ["JSON", "YAML", "SQL"],
},
{
type: "input",
name: "dataPath",
message: "What is the database dataPath?",
default() {
return "./Data";
},
},
{
type: "confirm",
name: "devLogs_enable",
message: "Do you want to enable devLogs?",
default() {
return false;
},
},
{
type: "input",
name: "devLogs_path",
message: "devLogs path:",
when: function (answers) {
return answers.devLogs_enable;
},
},
{
type: "password",
name: "secret",
message: "Enter Encrption Secret:",
mask: "*",
default() {
return "versedb";
},
},
])
.then(async (answers) => {
const configContent = {
[answers.connectionName]: {
adapter: answers.adapter,
dataPath: answers.dataPath,
devLogs: {
enable: answers.devLogs_enable,
path: answers.devLogs_path,
},
encryption: {
secret: answers.secret,
},
},
};
const dataPath = path.join(answers.dataPath, `connection.json`);
try {
fs.writeFileSync(dataPath, JSON.stringify(configContent));
} catch (error) {
if (error.code === "ENOENT") {
fs.mkdirSync(answers.dataPath, { recursive: true });
fs.writeFileSync(dataPath, JSON.stringify(configContent));
}
}
logSuccess({
content: "Database connection setup successfully.\n",
});
logInfo({
content: "Install verse.db package using.\n",
});
logInfo({
content: "npm install verse.db.\n",
});
});

4

package.json
{
"name": "create-verse.db",
"version": "0.0.3",
"version": "0.0.4",
"description": "verse.db isn't just a database, it's your universal data bridge. Designed for unmatched flexibility, security, and performance, verse.db empowers you to manage your data with ease.",

@@ -28,3 +28,3 @@ "license": "MIT",

"bin": {
"create-verse-db": "./index.js"
"create-verse-db": "./bin/cli.js"
},

@@ -31,0 +31,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc