cmd-johnson / node-power-info

Cross-platform node library for accessing battery power information
https://www.npmjs.com/package/node-power-info
MIT License
3 stars 2 forks source link

regex small fix #1

Closed b3by closed 8 years ago

b3by commented 8 years ago

I'm currently using battery-status in Atom from @cmd-johnson and noticed that when the battery is fully charged, the package cannot properly fetch the status. The output shows something like

 -InternalBattery-0     99%; charged;

I modified the regex for a quick fix, just hope it works. Not really a regex master here, so maybe it's not the best way to do it.

cmd-johnson commented 8 years ago

Thank you for that! I knew the correct text describing the 'full' status was missing, but it's a bit hard to find that text without having a mac to test it on. Some day I'll have to write native extensions for Linux, Darwin and Windows, but until then, getting the battery's status via command line is the one option that doesn't require compiling anything and can be done with only JavaScript. Oh, and sorry for the delay, I was ill for the last week, but now I'm better.

b3by commented 8 years ago

No problem dude ;) I was getting a weird error in Atom when using your battery plugin, when the battery level reaches 100% (I can se the correct text, but it cannot fetch the icon and I get a bunch of errors in the console, which I stupidly forgot to save). I think it should be fixed now, I'll keep you posted!