Win32 specific functions module for Cloud Commander.
npm install win32 --save
Read path and if it's root, return volumes
on win32
Get volumes of Windows platform
const win = require('win32');
const volumes = await win.getVolumes();
Convert cp437
(or other detected by prepareCodePage
) to utf8
;
const win = require('win32');
const {exec} = require('child_process');
exec('dir')
.stdout
.pipe(win.unicodify())
.pipe(process.stdout);
Set code page to 65001
which is utf8
. Will set back originial before exit.
const win = require('win32');
win.prepareCodePage();
Determines is command
is volume:
const win = require('win32');
win.isVolume('c:\\');
// returns on windows
true;
Determines is command
is changing of volume
:
const win = require('win32');
win.isChangeVolume('c:');
// returns
true;
MIT