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

vap-builder

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vap-builder - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

13

index.js

@@ -49,8 +49,7 @@ "use strict";

this.config = config;
if (config.yaml === false || config.mode !== 'vap') {
this.yamlLoader = new yaml_loader_1.NoFileLoader(config);
}
else {
this.yamlLoader = new yaml_loader_1.YamlFileLoader(config);
}
// if (config.yaml === false || config.mode !== 'vap') {
// this.yamlLoader = new NoFileLoader(config);
// } else {
this.yamlLoader = new yaml_loader_1.YamlFileLoader(config);
// }
if (!_.has(config, 'mode') || config.mode == 'vap') {

@@ -87,3 +86,3 @@ this.titleLoader = new title_loader_1.default(config);

e_1 = _a.sent();
console.error('Mysql 查询失败');
// console.error('Mysql 查询失败');
console.error(e_1);

@@ -90,0 +89,0 @@ return [3 /*break*/, 3];

{
"name": "vap-builder",
"version": "0.0.3",
"version": "0.0.4",
"description": "Fast VAP framework buider",

@@ -5,0 +5,0 @@ "main": "index.js",

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ejs_1 = require("ejs");
var ejs = require("ejs");
var fsPath = require("fs-path");
var _ = require("lodash");
var path = require("path");
var fs = require("fs");
var _ = require("lodash");
var Templete_1 = require("./Templete");
// page?: string,
// icon?: string,
// title?: string,
// subTitle: string,
var default_1 = /** @class */ (function () {

@@ -15,6 +13,10 @@ function default_1(config) {

this.outputDir = '';
this.templateDir = config.template || './html';
this.outputDir = config.output || '../dist';
this.templateDir = _.endsWith(this.templateDir, '/') ? this.templateDir.substr(0, this.templateDir.length - 1) : this.templateDir;
this.outputDir = _.endsWith(this.outputDir, '/') ? this.outputDir.substr(0, this.outputDir.length - 1) : this.outputDir;
var templateDir = config.template || './html';
var outputDir = config.output || '../dist';
templateDir = _.endsWith(templateDir, '/') ? templateDir.substr(0, templateDir.length - 1) : templateDir;
outputDir = _.endsWith(outputDir, '/') ? outputDir.substr(0, outputDir.length - 1) : outputDir;
this.templateDir = path.resolve(templateDir);
this.outputDir = path.resolve(outputDir);
console.log(this.templateDir);
console.log(this.outputDir);
}

@@ -24,4 +26,5 @@ default_1.prototype.writeAdmin = function (data) {

console.log("\u5F00\u59CB\u5199\u5165 " + writePath);
var str = ejs_1.default.render(Templete_1.ADMIN, data);
fs.writeFileSync(writePath, str);
var str = ejs.render(Templete_1.ADMIN, data);
fsPath.writeFile(writePath, str);
// fs.writeFileSync(writePath, str);
};

@@ -31,4 +34,5 @@ default_1.prototype.writeDisplay = function (data) {

console.log("\u5F00\u59CB\u5199\u5165 " + writePath);
var str = ejs_1.default.render(Templete_1.DISPLAY, data);
fs.writeFileSync(writePath, str);
var str = ejs.render(Templete_1.DISPLAY, data);
fsPath.writeFile(writePath, str);
// fs.writeFileSync(writePath, str);
};

@@ -38,4 +42,5 @@ default_1.prototype.writeScreen = function (data) {

console.log("\u5F00\u59CB\u5199\u5165 " + writePath);
var str = ejs_1.default.render(Templete_1.SCREEN, data);
fs.writeFileSync(writePath, str);
var str = ejs.render(Templete_1.SCREEN, data);
fsPath.writeFile(writePath, str);
// fs.writeFileSync(writePath, str);
};

@@ -47,4 +52,5 @@ default_1.prototype.writePortal = function (data) {

var template = fs.readFileSync(tempPath).toString();
var str = ejs_1.default.render(template, data);
fs.writeFileSync(writePath, str);
var str = ejs.render(template, data);
fsPath.writeFile(writePath, str);
// fs.writeFileSync(writePath, str);
};

@@ -56,13 +62,7 @@ default_1.prototype.writeLogin = function (data) {

var template = fs.readFileSync(tempPath).toString();
var str = ejs_1.default.render(template, data);
fs.writeFileSync(writePath, str);
var str = ejs.render(template, data);
fsPath.writeFile(writePath, str);
// fs.writeFileSync(writePath, str);
};
default_1.prototype.writeCustom = function (data) {
// ejs.renderFile('', data, {}, function (err, str) {
// if (err) {
// console.error(err);
// throw err;
// }
// console.log(str);
// });
};

@@ -69,0 +69,0 @@ default_1.prototype.write = function (data) {

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