Code Monkey home page Code Monkey logo

electron-shutdown-command's People

Contributors

samuelcarreira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

electron-shutdown-command's Issues

Abort doesn't work on Windows

When I'm logging process.platform it results in win32, but I'm still unable to run your abort-function.
The solution would be to change the condition of the first if-statement at the abort-function at line 101

from

process.platform !== 'win32' || process.platform !== 'linux'

to

process.platform !== 'win32' && process.platform !== 'linux'

Nested arrays of arguments intended?

setTimer returns an array of arguments which is then pushed into the arguments in the enclosing command's function. This produces an array of arguments like so: ['shutdown', ['-t 0']]. In this implementation there is only one argument added in the setTimer function but if there were more than one it would result in a comma added between the arguments.

The code in it's current form throws an error when evaluated by TypeScript.

reboot needs options

I get a TypeError: Cannot read property 'sudo' of undefined on index.js:118. This is caused by calling reboot() without an argument on Linux. I suggest to provide a default {} value for the argument to avoid this.

Scheduling shutdown

Hi, @samuelcarreira . Firstly, thanks for your work in this lib!!

I was trying to schedule a shutdown. Since all of the existent SO permit this function, this could be a an relevant feature for the lib.

Right now I'm just calculating the interval from current time to the shutdown point, but a more direct approach would be to just pass the time you want to shutdown.

If you think that this feature is relevant for the project I could help with tests or taking a look and submitting a PR.

Thanks for all.

How about removing electron dependency? (and create new package)

Hi

I was looking for cross platform shutdown npm package and found yours. It seems to be working nice so kudos to you!

The problem is that my project has nothing to do with Electron so I don't want to use it and download unnecessary packages.

What do you think about extracting the core "shutdown/hibernate/sleep/etc" logic into the separate package and publish it as a new npm? I can do it too but I just didn't want to basically take your entire code and publish it as mine package.

Please let me know. Thanks!
Maks

Windows shutdown not working

I don't know if this project is still maintained, but I am going to ask my question anyways.
When starting the project with npm or yarn I am able to use every single command you offer. However, when packaged something seems odd. Every shutdown I tried just creates a new instance of the application. Some kind of security is in my way, created both by electron-packager oder electron-builder. Even calling a batch or c++ executable doesn't seem to change the problem.
I am running the newest version of electron and the packagers on windows 10.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.