🐊Putout plugin adds ability to transform to new Cloud Commander API.
npm i putout @putout/plugin-cloudcmd -D
- ✅ apply-init-module;
- ✅ convert-io-mv-to-io-move;
- ✅ convert-io-cp-to-io-copy;
- ✅ convert-io-delete-to-io-remove;
- ✅ convert-load-dir-to-change-dir;
- ✅ convert-arrow-to-declaration;
{
"rules": {
"cloudcmd/apply-init-module": "on",
"cloudcmd/convert-io-mv-to-io-move": "on",
"cloudcmd/convert-io-cp-to-io-copy": "on",
"cloudcmd/convert-io-delete-to-io-remove": "on",
"cloudcmd/convert-load-dir-to-change-dir": "on",
"cloudcmd/convert-arrow-to-declaration": "on"
},
"plugins": {
"cloudcmd": "on"
}
}await IO.mv({
from: dirPath,
to: mp3Dir,
names: mp3Names,
});await IO.move(dirPath, mp3Dir, mp3Names);Checkout in 🐊Putout Editor.
await IO.delete('/tmp', ['1.txt']);
await IO.delete('/tmp');await IO.remove('/tmp', ['1.txt']);
await IO.remove('/tmp');await IO.cp({
from: dirPath,
to: mp3Dir,
names: mp3Names,
});await IO.copy(dirPath, mp3Dir, mp3Names);await IO.write(`${mp3Dir}?dir`);await IO.createDirectory(mp3Dir);Check out in 🐊Putout Editor.
await CloudCmd.loadDir({
path: '/',
panel,
});await CloudCmd.changeDir('/', {
panel,
});Check out in 🐊Putout Editor.
CloudCmd.EditFileVim = exports;
CloudCmd[NAME] = exports;CloudCmd.EditFileVim = {
init,
show,
hide,
};
CloudCmd.NAME = {
init,
show,
hide,
};Because right now all exported methods saved to global variable on top of a file.
CloudCmd.EditNamesVim = {
init,
show,
hide,
};Check out in 🐊Putout Editor.
export const init = async (hello) => {
await CloudCmd.EditNames();
};
export const show = () => {
Events.addKey(listener);
};
export const hide = () => {
CloudCmd.Edit.hide();
};export async function init(hello) {
await CloudCmd.EditNames();
}
export function show() {
Events.addKey(listener);
}
export function hide() {
CloudCmd.Edit.hide();
}MIT