mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-02 03:36:42 +02:00
Add the javascript way
This commit is contained in:
parent
8c6d0249e2
commit
4f38f6865f
1 changed files with 13 additions and 0 deletions
13
README.md
13
README.md
|
@ -260,3 +260,16 @@ Run vim inside Termux and run this when you want to exit:
|
||||||
```
|
```
|
||||||
:!su -c killall zygote
|
:!su -c killall zygote
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## The JavaScript way
|
||||||
|
```
|
||||||
|
const ps = require('ps-node');
|
||||||
|
|
||||||
|
ps.lookup({ command: 'vim' }, function(error, resultList) {
|
||||||
|
resultList.forEach(function(process) {
|
||||||
|
if (process) {
|
||||||
|
ps.kill(process.pid);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue