![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Suspend and resume processes on Windows using NtSuspendProcess()
and
NtResumeProcess()
. This is a Node.js only module, it won't run in any
browser or other JavaScript environments.
This project includes TypeScript declarations.
Feel free to ask anything by opening an issue on GitHub.
Only NodeJS 10.x or higher is supported
The library can be installed from NPM or from GitHub:
npm i ntsuspend
npm i FedericoCarboni/node-ntsuspend
To use it in your project you can import
or require()
it.
import { suspend, resume } from 'ntsuspend';
const { suspend, resume } = require('ntsuspend');
Note: Make sure to use this package as an optional dependency if you want to
support multiple operating systems. Optional imports in ESM can be achieved with
top-level await
, still unavailable in LTS releases, and dynamic import
or by
using createRequire()
.
if (process.platform === 'win32') {
const ntsuspend = await import('ntsuspend');
// ... use ntsuspend
}
import { createRequire } from 'module';
if (process.platform === 'win32') {
const ntsuspend = createRequire(import.meta.url)('ntsuspend');
// ... use ntsuspend
}
In CommonJS require()
can already be used conditionally.
if (process.platform === 'win32') {
const ntsuspend = require('ntsuspend');
// ... use ntsuspend
}
The package exports suspend()
and resume()
, they take the process' PID and
return true
on success, false
otherwise.
if (!suspend(pid))
console.log('Could not suspend process');
if (!resume(pid))
console.log('Could not resume process');
If you are using Node.js' child processes the process id can be obtained by using subprocess.pid
.
Note: make sure that you're passing the actual process id to ntsuspend; the ChildProcess
instance returned by child_process.exec
is a handle to the shell not to the actual subprocess. Use child_process.spawn
and make sure that the shell
option is disabled.
See #3.
const subprocess = spawn('executable');
if (!suspend(subprocess.pid))
console.log('Could not suspend process');
Note: If you're not on Windows suspend()
and resume()
will be undefined
.
This library uses NtSuspendProcess()
and NtResumeProcess()
from NTDLL
, these functions are not
officially documented on MSDN; they have been consistently available since Windows XP, but are not
guaranteed to work in the future.
FAQs
Suspend and resume processes on Windows
We found that ntsuspend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.