首先,我将录像带分为以下几段:刺.服务器(视窗),随后我建立了一个档案,我需要移交给另一个服务器(发电机服务器、LC),在这种档案中,录像和(或)图像、框架和数据。
为节约起见,我使用抽取式图书馆(以阿鲁兹语为基础),并使用利用利用模块进行推广。
问题在于,当我向信使发送图像以供处理时,一切照旧;然而,当我发送录像时,我发现这一错误——中央名录记录签名的结尾没有发现。
在我看来,这个问题与偶然或事件流有关。
- I tried not to use promisify, but then I have the following problem - at the moment when I need to use data from the archive, this archive does not yet exist ( folder do not exist );
- Tried some more libraries for unarchiving adamzip, unzip, decompress, node-zip;
- I tried to make a chain of promises;
...
const fs = require( fs-extra )
const path = require( path )
cosnt util = require( util )
const extractZip = util.promisify(require( extract-zip ))
...
...
/**
* Factory that creates a project based on the archive.
* @param {string} archive Path to the source archive
* @returns {Promise.<Project>}
*/
static async create (archive) {
const dir = fs.mkdtempSync(path.join(this.baseDir, / ))
await extractZip(archive, { dir })
const data = await fs.readJson(path.join(dir, data.json ))
return new this(data, dir)
}
...
/* Tried to do this w/ chaining promises:
static async create (archive) {
const dir = fs.mkdtempSync(path.join(this.baseDir, / ))
await extractZip(archive, { dir })
.then( async () => {
const data = await fs.readJson(path.join(dir, data.json ))
return data
})
.then( async (data) => {
return new this(data, dir)
})
}
*/