Check if the process is running as Administrator on Windows
$ npm install is-admin
const isAdmin = require('is-admin');
(async () => {
console.log(await isAdmin());
//=> false
})();
Returns a Promise<boolean>
indicating whether the process is running as Administrator.
- is-elevated - Check if the process is running with elevated privileges (cross-platform)
MIT © Sindre Sorhus