
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-ajax-snapshot
Advanced tools
Nodejs wrapper of phantomjs-ajax-snapshot, generates static pages from ajax / non-ajax source pages and allows stripping of DOM elements identifying them by id, class, name or meta-property (only for meta tags).
Nodejs wrapper of phantomjs-ajax-snapshot, generates static pages from ajax / non-ajax source pages and allows stripping of DOM elements identifying them by id, class, name or meta-property (only for meta tags).
npm install node-ajax-snapshot --save
Options:
(sourceFile | sourceUrl)
-sourceFile (string) file with json array format, containing the set of urls to generate.
-sourceUrl (string) single url to visit.
-basePath (string) common basepath among urls.
-separator (string) separator to replace '/' in file names ([---] by default).
-waitingTime (miliseconds) Use specified waiting time to load javascript of every page (3000 by default).
-outputDir (string) place to write the output files (snapshots/ by default).
-idlist (Array) elements id to strip in html (empty by default).
-classlist (Array) elements class to strip in html (empty by default).
-metalist (Array) elements metaname to strip in html (empty by default).
-debug (boolean) Enables debug messages (false by default).
-outputFormat: (string) png gif jpeg pdf (html by default).
var nodeAjaxSnapshot = require('node-ajax-snapshot');
Minimal config:
var nasStream = nas.takeSnapshots({
sourceFile: 'urlFile.json' // file with json array format, containing the set of urls to generate.
});
or with an url directly:
var nasStream = nas.takeSnapshots({
sourceUrl: 'www.ajax-example.com/basepath/' // url to generate.
});
Normal config:
var nasStream = nodeAjaxSnapshot.takeSnapshots({
basePath: 'www.ajax-example.com/app/',
sourceFile: 'urlFile.json', // file with json array format, containing the set of urls to generate.
separator: '[---]',
waitingTime: 2000, // waiting time between urls. 3000 miliseconds by default
outputDir: path.join(__dirname, 'NodeAjaxSnapshot', 'snapshots'+path.sep),
filters: {
idlist: [],
classlist: [],
metalist: []
},
debug: false // false by default
});
nasStream.stdout.on('data', function (data) {
console.log(data.toString());
});
nasStream.stderr.on('data', function (data) {
console.log(data.toString());
});
nasStream.on('close', function (code) {
console.log('nasStream child process exited with code ['+ code+']');
});
npm test (not yet)
Phantomjs headless webkit with JS API + phantomjs wrapper for node + phantomjs-ajax-snapshot.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
Eric Lara, supported by Ondho.
MIT
FAQs
Nodejs wrapper of phantomjs-ajax-snapshot, generates static pages from ajax / non-ajax source pages and allows stripping of DOM elements identifying them by id, class, name or meta-property (only for meta tags).
We found that node-ajax-snapshot 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.