You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To convert Cloud Commander to ESM same changes in API should be made:
According to base usage example:
importhttpfrom'http';importcloudcmdfrom'cloudcmd';import{Server}from'socket.io';importexpressfrom'express';constapp=express();constport=1337;constprefix='/';constserver=http.createServer(app);constsocket=newServer(server,{path: `${prefix}socket.io`,});constconfig={name: 'cloudcmd :)',};constfilePicker={data: {FilePicker: {key: 'key',},},};// override option from json/modules.jsonconstmodules={
filePicker,};const{
createConfigManager,
configPath,}=cloudcmd;constconfigManager=createConfigManager({
configPath,});app.use(prefix,cloudcmd({
socket,// used by Config, Edit (optional) and Console (required)
config,// config data (optional)
modules,// optional
configManager,// optional}));server.listen(port);
this part:
app.use(prefix,cloudcmd({
socket,// used by Config, Edit (optional) and Console (required)
config,// config data (optional)
modules,// optional
configManager,// optional}));
Should be changed to have ability to importTerminal. Right now it uses require, but in ESM in will be async, so we will have ability init cloudcmd this way:
app.use(prefix,awaitcloudcmd({
socket,// used by Config, Edit (optional) and Console (required)
config,// config data (optional)
modules,// optional
configManager,// optional}));
It looks little bit awkward, and this is a good place for bugs to occur.
Any ideas, about how convenient this change will be, and is it worth it?
To convert Cloud Commander to
ESM
same changes in API should be made:According to base usage example:
this part:
Should be changed to have ability to
import
Terminal. Right now it usesrequire
, but inESM
in will beasync
, so we will have ability initcloudcmd
this way:It looks little bit awkward, and this is a good place for bugs to occur.
Any ideas, about how convenient this change will be, and is it worth it?
According to coderaiser/spawnify#3, @wll8, what do you think? have you tried API?
The text was updated successfully, but these errors were encountered: