
Research
5 Malicious Chrome Extensions Enable Session Hijacking in Enterprise HR and ERP Systems
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.
hook-scripts
Advanced tools
Add git-style hooks to your node module.
npm install hook-scripts
var hooks = require('hook-scripts')();
hooks('hook-name', function (hook) {
hook.on('close', function (code) {
console.log('Script exited with code', code);
});
hook.stdout.pipe(process.stdout);
hook.stderr.pipe(process.stderr);
});
By default, hook-scripts will look for a hooks folder in the current
working directory (process.cwd()). You can override this behavior by
parsing in a path to a different directory upon initialization:
var hooks = require('hook-scripts')('/path/to/hooks');
It's expected that the hook names map to filenames inside the hooks directory.
You can parse in arguments to the hook script using an optional 2nd argument when registering the hook:
hooks('hook-name', ['arg1', 'arg2'], function (hook) {...});
An initializer is returned when requireing hook-scripts. It takes one
optional argument which can either be a string or an options hash.
require('hook-scripts')([dir || options]);
The string is just a shorthand for parsing in { dir: string }.
The full list of options are:
dir - The directory in which to look for the hook scriptscwd - The working directory in which to run the hook scripts (defaults to process.cwd())overrides - An optional hash of hook script overrides (see the Advanced section below)The hooks can be written in any language that you prefer. Just make sure they are executable and include a hashbang in the top of the script.
Here are some examples in various languages:
Bash
#!/usr/bin/env bash
echo 'Hello World'
Node.js
#!/usr/bin/env node
console.log('Hello World');
Ruby
#!/usr/bin/env ruby
puts 'Hello World'
Using the initialization option overrides it's possible to override
individual hooks:
var hooks = require('hook-scripts')({ overrides: { foo: 'echo bar' } });
// will run `echo bar` instead of looking for a script named foo
hooks('foo', function (hook) {
hook.stdout.pipe(process.stdout); // pipes `bar\n` to STDOUT
});
MIT
FAQs
Add git-style hooks to your node project
The npm package hook-scripts receives a total of 0 weekly downloads. As such, hook-scripts popularity was classified as not popular.
We found that hook-scripts 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.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.