dsch-electron-edge-js
Version:
Edge.js: run .NET and Node.js in-process on Electron
30 lines (22 loc) • 776 B
JavaScript
// Overview of edge.js: http://tjanczuk.github.com/edge
var edge = require('../lib/edge')
, path = require('path');
var zipDirectory = edge.func(function() {/*
#r "System.IO.Compression.FileSystem.dll"
using System.IO.Compression;
async (dynamic input) =>
{
await Task.Run(async () => {
ZipFile.CreateFromDirectory((string)input.source, (string)input.destination);
});
return null;
}
*/});
var params = {
source: path.join(__dirname, '..', 'samples'),
destination: path.join(__dirname, '..', 'samples.zip')
};
zipDirectory(params, function (error) {
if (error) throw error;
console.log('The samples directory has been compressed to ..\\samples.zip file.');
});