{"id":16815592,"url":"https://github.com/ericzon/node-ajax-snapshot","last_synced_at":"2025-03-17T12:28:42.954Z","repository":{"id":26436984,"uuid":"29887680","full_name":"ericzon/node-ajax-snapshot","owner":"ericzon","description":"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).","archived":false,"fork":false,"pushed_at":"2016-05-12T12:00:32.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T22:17:44.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-ajax-snapshot","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericzon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-26T23:37:46.000Z","updated_at":"2016-07-17T21:17:25.000Z","dependencies_parsed_at":"2022-08-29T06:01:11.106Z","dependency_job_id":null,"html_url":"https://github.com/ericzon/node-ajax-snapshot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericzon%2Fnode-ajax-snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericzon%2Fnode-ajax-snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericzon%2Fnode-ajax-snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericzon%2Fnode-ajax-snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericzon","download_url":"https://codeload.github.com/ericzon/node-ajax-snapshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244033082,"owners_count":20386871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T10:34:54.990Z","updated_at":"2025-03-17T12:28:42.929Z","avatar_url":"https://github.com/ericzon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-ajax-snapshot\n==================\n\nNodejs wrapper of [phantomjs-ajax-snapshot](https://github.com/ericzon/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).\n\n## Installation\n\n  npm install node-ajax-snapshot --save\n\n## Usage\n\n  Options:\n\n    (sourceFile | sourceUrl)\n\n    -sourceFile    (string) file with json array format, containing the set of urls to generate.\n\n    -sourceUrl    (string) single url to visit.\n\n    -basePath    (string) common basepath among urls.\n\n    -separator    (string) separator to replace '/' in file names ([---] by default).\n\n    -waitingTime    (miliseconds) Use specified waiting time to load javascript of every page (3000 by default).\n\n    -outputDir    (string) place to write the output files (snapshots/ by default).\n\n    -idlist    (Array) elements id to strip in html (empty by default).\n\n    -classlist    (Array) elements class to strip in html (empty by default).\n\n    -metalist    (Array) elements metaname to strip in html (empty by default).\n\n    -debug    (boolean) Enables debug messages (false by default).\n\n    -outputFormat: (string) png gif jpeg pdf (html by default).\n\n## Examples\n\n```javascript\n\n  var nodeAjaxSnapshot = require('node-ajax-snapshot');\n\n```\n\n  Minimal config:\n\n```javascript\n\n    var nasStream = nas.takeSnapshots({\n          sourceFile: 'urlFile.json'            // file with json array format, containing the set of urls to generate.\n        });\n\n    or with an url directly:\n\n    var nasStream = nas.takeSnapshots({\n          sourceUrl: 'www.ajax-example.com/basepath/'           // url to generate.\n        });\n```\n\n  Normal config:\n\n```javascript\n\n    var nasStream = nodeAjaxSnapshot.takeSnapshots({\n          basePath: 'www.ajax-example.com/app/',\n          sourceFile: 'urlFile.json',           // file with json array format, containing the set of urls to generate.\n          separator: '[---]',\n          waitingTime: 2000,                    // waiting time between urls. 3000 miliseconds by default\n          outputDir: path.join(__dirname, 'NodeAjaxSnapshot', 'snapshots'+path.sep),\n          filters: {\n            idlist: [],\n            classlist: [],\n            metalist: []\n          },\n          debug: false                          // false by default\n        });\n\n    nasStream.stdout.on('data', function (data) {\n        console.log(data.toString());\n    });\n\n    nasStream.stderr.on('data', function (data) {\n        console.log(data.toString());\n    });\n\n    nasStream.on('close', function (code) {\n        console.log('nasStream child process exited with code ['+ code+']');\n    });\n\n```  \n\n## Tests\n\n  npm test (not yet)\n\n## Dependencies\n\n  [Phantomjs](http://phantomjs.org/ \"Phantomjs' Homepage\") headless webkit with JS API + [phantomjs](https://www.npmjs.com/package/phantomjs) wrapper for node + [phantomjs-ajax-snapshot](https://github.com/ericzon/phantomjs-ajax-snapshot).\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style.\nAdd unit tests for any new or changed functionality. Lint and test your code.\n\n## Author\n\n[Eric Lara](https://www.twitter.com/EricLaraAmat), supported by [Ondho](http://www.ondho.com).\n\n## License\n\n  MIT\n\n## Changelog\n\n* 0.0.5 Added seo parameter to allow filtering from client.\n  0.0.4 Added format parameter.\n  0.0.3 Added phantom's parameter to avoid errors.\n  0.0.2 Added better docs.\n  0.0.1 Initial commit\n\n## Roadmap\n\n* connect with [node-ajax-seo](https://github.com/ericzon/node-ajax-seo) (WIP).\n* generate images from pages (WIP).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericzon%2Fnode-ajax-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericzon%2Fnode-ajax-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericzon%2Fnode-ajax-snapshot/lists"}