
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
phantom-server
Advanced tools
This project uses the webserver library in PhantomJS to host a simple phantomjs webserver that will run scripts you pass it over http. This allows you to easily run scripts that require the DOM (d3, js enabled web scrapers) from NodeJS.
This is a simple example demonstrating that window will be defined in your evaluate
scripts. For a more complex example that uses d3, see examples/d3.
# script.js
/**
* This is the function that will be run in the page by PhantomJS. It has access
* anything you would normally have access to in a page.
*/
module.exports = function() {
return window !== undefined;
};
# index.js
var path = require( 'path' );
var PhantomServer = require( 'phantom-server' ),
phantomjs_path = require( 'phantomjs-prebuilt' ).path;
var phantom_server = new PhantomServer( phantomjs_path );
phantom_server
.run( {
evaluate_scripts: [
path.join( __dirname, 'script.js' );
]
} )
.then( function( evaluate_responses ) {
console.log( evaluate_responses[ 0 ] ); // true
phantom_server.stop(); // MAKE SURE YOU STOP THE SERVER WHEN YOU ARE DONE
} );
FAQs
Allows you to interact with PhantomJS from NodeJS by hosting it as a server
We found that phantom-server 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.