amqplib-init 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +0 -32
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,10 +1,6 @@
1
- import url from "url";
2
1
  const amqp = require('amqplib');
3
2
  const shelljs = require('shelljs');
4
3
  const chalk = require('chalk-style');
5
- const Base64 = require('js-base64').Base64;
6
- const querystring = require('querystring');
7
- const shell = require('shelljs');
8
4
 
9
5
  const sleep = (time) => {
10
6
  return new Promise(resolve => {
@@ -99,33 +95,5 @@ module.exports = {
99
95
  chalk.log(`✳️-队列已启动: finish~`);
100
96
  finish && finish();
101
97
  })
102
- },
103
- /**
104
- * 执行控制器方法
105
- * @param api 控制器
106
- * @param data 携带数据
107
- * @param dir 执行目录
108
- * @returns {Promise<unknown>}
109
- */
110
- toAction(api = '', data= {}, dir = ''){
111
- const query = querystring.stringify(data);
112
- const base = Base64.encode(query);
113
- return new Promise((resolve, reject) => {
114
- const sql = `php ${dir}/think action ${api} -o ${base}`;
115
- chalk.warning(`即将执行命令: ${sql}`);
116
- shell.exec(sql).code !== 0 ? reject('执行失败') : resolve('执行成功');
117
- })
118
- },
119
- /**
120
- * 获取绝对路径
121
- * @param path 相对路径
122
- * @returns {*}
123
- */
124
- getRoot(path = ''){
125
- // 获取当前模块的 URL
126
- const __filename = url.fileURLToPath(import.meta.url);
127
- // 转换为目录路径
128
- const __dirname = path.dirname(__filename);
129
- return path.resolve(__dirname, path);
130
98
  }
131
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amqplib-init",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "消息队列初始化",
5
5
  "main": "index.js",
6
6
  "scripts": {