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

devospa

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devospa - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

48

cli.js
#!/usr/bin/env node
const rimraf = require("rimraf");
var FormData = require('form-data');
var fs = require('fs');
var program = require("commander");
var inquirer = require('inquirer');
var axios = require('axios');
var { zip } = require('zip-a-folder');
var package = require("./package.json");
const FormData = require('form-data');
const fs = require('fs');
const program = require("commander");
const inquirer = require('inquirer');
const got = require('got');
const { zip } = require('zip-a-folder');
const package = require("./package.json");
const concat = require("concat-stream")

@@ -15,2 +15,5 @@ const cliProgress = require('cli-progress');

// const baseURL = "http://devospa.com"
const baseURL = "http://localhost:3020"
program

@@ -29,9 +32,4 @@ .version(package.version, "-v, --version");

console.log(buildFolder + " folder will be zipped and uploaded to devospa.com")
const api = axios.create({
maxContentLength: Infinity,
maxBodyLength: Infinity,
baseURL: "http://devospa.com",
// baseURL: "http://localhost:3020",
})
return api.post("/devospaApi/checkProjectToken", { token }).then(async() => {
const url = baseURL+"/devospaApi/checkProjectToken"
return got.post(url, { json: { token } }).then(async() => {
return inquirer.prompt([

@@ -48,9 +46,2 @@ {

await zip(buildFolder, zipPath);
progressBar.update(10);
let n = 10
const intervalObj = setInterval(() => {
const nn = (100 + n) / 2
n += Math.min(10, nn - n)
progressBar.update(n)
}, 500)
new Promise((resolve) => {

@@ -63,11 +54,7 @@ const fd = new FormData();

}).then(({ data, headers }) => {
return api.post("/devospaApi/upload", data, {
headers,
onUploadProgress: progressEvent => {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
progressBar.update(percentCompleted);
}
}).then((uploadResponse) => {
clearInterval(intervalObj)
return got.post(baseURL+"/devospaApi/upload", { body: data, headers})
.on('uploadProgress', progress => {
progressBar.update(Math.round(progress.percent * 100));
})
.then((uploadResponse) => {
progressBar.update(100)

@@ -104,2 +91,3 @@ progressBar.stop(100)

}).catch(e => {
console.log(e)
console.error("the project token is wrong, please copy the command from devospa.com")

@@ -106,0 +94,0 @@ })

{
"name": "devospa",
"version": "1.1.0",
"version": "1.2.0",
"scripts": {
"build": "node cli",
"dev": "node cli.js",
"publish": "node cli"
"dev": "node cli.js"
},

@@ -13,3 +11,2 @@ "bin": {

"dependencies": {
"axios": "^0.21.1",
"cli-progress": "^3.9.0",

@@ -19,2 +16,3 @@ "commander": "^7.2.0",

"form-data": "^4.0.0",
"got": "^11.8.2",
"inquirer": "^8.1.1",

@@ -21,0 +19,0 @@ "rimraf": "^3.0.2",

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