Socket
Socket
Sign inDemoInstall

dex8-cli

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dex8-cli - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

3

bin/index.js

@@ -81,3 +81,4 @@ #!/usr/bin/env node

.command('start')
.option('-i, --input <inp>', 'Select input file, for example "my_input.js".')
.option('-i, --input <inp>', 'Select input file, for example "input_user1.js" or "input_user1.json".')
.option('-l, --library <lib>', 'Select library file, for example "input_library.js".')
.description('Start dex8 task with or without input file.')

@@ -84,0 +85,0 @@ .action(start);

@@ -9,2 +9,3 @@ /**

const moment = require('moment');
const { EventEmitter } = require('events');

@@ -25,2 +26,3 @@

const input_selected = optionsObj.input;
const library_selected = optionsObj.library;

@@ -41,3 +43,3 @@

/**** 4) GET main & input ****/
/**** 4) Fetch main function ****/
const mainPath = path.join(process.cwd(), 'main.js');

@@ -49,2 +51,4 @@ const mainExists = await fse.pathExists(mainPath);

/**** 5) Fetch input ****/
let input;

@@ -60,6 +64,21 @@ if (!!input_selected) {

/**** 6) Fetch input library ****/
let library;
if (!!library_selected) {
const library_selectedPath = path.join(process.cwd(), library_selected);
const libraryExists = await fse.pathExists(library_selectedPath);
if (!libraryExists) { console.log(chalk.red(`Library file does not exists: ${library_selected}`)); return; }
// delete require.cache[library_selectedPath];
library = require(library_selectedPath);
} else {
const eventEmitter = new EventEmitter();
eventEmitter.setMaxListeners(5); // 10 by default
library = { eventEmitter };
}
/**** 5) EXECUTE main ****/
/**** 7) EXECUTE main ****/
try {
const output = await main(input);
const output = await main(input, library);
console.log(`\nTask "${task_title}" is ended on ${shortNow()}`);

@@ -66,0 +85,0 @@ console.log('output:: ', output);

const FunctionFlow = require('functionflowx');
const Echo = require('echoer');
const { EventEmitter } = require('events');

@@ -7,5 +8,9 @@ const f1 = require('./f1.js');

module.exports = async (input, eventEmitter) => {
module.exports = async (input) => {
if (!input) { throw new Error('Input is required.'); }
// create event emitter
const eventEmitter = new EventEmitter();
eventEmitter.setMaxListeners(5); // 10 by default
const ff = new FunctionFlow({ debug: false, msDelay: 800 }, eventEmitter);

@@ -12,0 +17,0 @@ const echo = new Echo(true, 10, eventEmitter);

{
"name": "dex8-cli",
"version": "1.0.1",
"version": "1.1.0",
"title": "DEX8 CLI",

@@ -5,0 +5,0 @@ "description": "Dex8 CLI is a command line interface which helps developers to create and run dex8.com tasks (automated serverless scripts).",

@@ -48,3 +48,3 @@ # DEX8 CLI

#### <span style="color:maroon">$ dex8 init &lt;taskName&gt;</span>
#### $ dex8 init &lt;taskName&gt;
Use this command to start a new project (Dex8 Task). It will create a taskName folder with initial files.

@@ -54,19 +54,20 @@ a) After init, move to created directory to continue using dex8 commands: *$ cd taskName*

#### <span style="color:maroon">$ dex8 login</span>
#### $ dex8 login
Login to Dex8 Web Panel with your username and password. After successfully logging in, a "conf.js" file is created. It contains a JWT Authentication Token and other sensitive data so please include it in .gitignore and NEVER push this file in the git repository.
#### <span style="color:maroon">$ dex8 logout</span>
#### $ dex8 logout
Logout from Dex8 Web Panel. It is highly recommended to logout every time development work is finished because it will delete the "conf.js" file.
#### <span style="color:maroon">$ dex8 delete &lt;taskName&gt;</span>
#### $ dex8 delete &lt;taskName&gt;
Delete a Dex8 task. This command will delete the whole taskName folder. Curent working directory can be either in taskName or in its upper, parent directory.
#### <span style="color:maroon">$ dex8 start -i input.json</span>
#### $ dex8 start -i input.json -l library.js
When a task is created use this command to run a Dex8 task locally. Echo messages will be printed in terminal.
```
Options:
-i --input <inputFile.js> select input file (initial data for Dex8 task)
-i --input <input.js | input.json> select input file (initial data for Dex8 task)
-l --library <library.js> select library file (initial libs for Dex8 task)
```
#### <span style="color:maroon">$ dex8 upload</span>
#### $ dex8 upload
Upload the task on the Dex8 serverless platform.

@@ -83,3 +84,3 @@ ```

#### <span style="color:maroon">$ dex8 update</span>
#### $ dex8 update
Update task details without uploading the task files.

@@ -91,3 +92,3 @@ This command will read what is written in "manifest.json" and "howto.html" and update the task.

#### <span style="color:maroon">$ dex8 download &lt;task_id&gt;</span>
#### $ dex8 download &lt;task_id&gt;
Download task files by task_id. Parameter task_id can be found in Web Panel / Tasks table.

@@ -94,0 +95,0 @@ This command will first delete all files in the folder and then create new, downloaded files.

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