Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
exit_on_eof
Advanced tools
exit_on_eof
Helper script for Elixir/Phoenix projects using npm scripts
as a watcher instead of Brunch
npm install -g exit_on_eof
Elixir/Phoenix projects use Brunch by default for front-end workflows, but this can be modified to use
a simpler approach like npm scripts
as described here. A problem arises though
when killing/exiting the server. Phoenix sends an EOF signal through stdin
to the watch process
to indicate it should terminate. npm scripts
, like many commands, does not respond to EOF like SIGINT
so the node processes remain running.
This script helps deal with this issue by wrapping a user-given command in a parent process that is sensitive to both SIGINT and EOF.
To read more about this sensitivity to EOF as per Chris McCord, view this
(Both Webpack and Brunch were actively PR'd to allow for this behavior. This is a stop-gap until a more elegant solution presents.)
###Usage
In Phoenix project update config/dev.exs
:
config :{YOUR_PROJECT_NAME_ATOM}, {YOUR_PROJECT_NAME}.Endpoint
...
watchers: [exit_on_eof: ["npm run watch"]]
In your package.json
:
{
...
"scripts": {
...
"watch": some set of commands
...
},
...
}
When you start the server your command should run and when you stop the server the node processes that were spun up to manage the front-end build will also be killed.
FAQs
Run a command as a child process and exit process upon EOF (^D)
The npm package exit_on_eof receives a total of 195 weekly downloads. As such, exit_on_eof popularity was classified as not popular.
We found that exit_on_eof 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.