Add method handleDroppedFile
:
async handleDroppedFile(payload) {
this.broker.emit('compressor.compressed', {
id: payload.id,
...await this.compressFile(payload.filePath)
});
}
// Very fast-coded deduplication utility. It parses standard "Storage Analyzer" report and moves duplicated files to a separate folder. | |
// Requires "npm i csv-parse 'move-file" | |
'use strict'; | |
const path = require('path') | |
const fs = require('fs') | |
const parse = require('csv-parse/lib/sync') | |
const moveFile = require('move-file'); |
Add method handleDroppedFile
:
async handleDroppedFile(payload) {
this.broker.emit('compressor.compressed', {
id: payload.id,
...await this.compressFile(payload.filePath)
});
}
Add handleEvent
method:
handleEvent(payload, sender, event) {
this.metadata.webContents.send(event, payload);
}
Subscribe on event emit
in method serviceCreated
:
import { Injectable } from '@angular/core'; | |
import { ElectronService } from 'ngx-electron'; | |
import * as _ from 'lodash'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class IPCService { |
'use strict'; | |
const { spawn } = require('threads'); | |
const { ServiceBroker } = require('moleculer'); | |
const ElectronService = require('./services/electron.service'); | |
class Loader { | |
static get config() { |
const {Service} = require('moleculer'); | |
const {app, ipcMain} = require('electron'); | |
class ElectronService extends Service { | |
constructor(broker) { | |
super(broker); | |
this.parseServiceSchema({ | |
name: 'electron', |
const { Service } = require('moleculer'); | |
const compressFileHelper = require('../utils/compress-file'); | |
class CompressorService extends Service { | |
constructor(broker) { | |
super(broker); | |
this.parseServiceSchema({ |
Короче сама бд и api к ней: https://github.com/louischatriot/nedb
package.json
:{
'use strict'; | |
const exec = require('child_process').exec; | |
const https = require('https'); | |
const API_KEY = `*****`; | |
const PHONE_NUMBER = `7920*****`; | |
let state = 'Unknown'; |
In order to tunnel all iOS Internet traffic using SSH:
config.pac
file to copy it to a clipboard.See a detailed video: https://www.youtube.com/watch?v=8r0eEr36Dg4