{"id":17068931,"url":"https://github.com/localnerve/grunt-html-snapshots","last_synced_at":"2025-03-23T10:41:37.543Z","repository":{"id":506463,"uuid":"10111331","full_name":"localnerve/grunt-html-snapshots","owner":"localnerve","description":"Grunt task for html-snapshots","archived":false,"fork":false,"pushed_at":"2024-04-11T02:59:56.000Z","size":995,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-13T07:46:29.098Z","etag":null,"topics":["grunt-task","html-snapshots"],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/localnerve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2013-05-16T21:52:37.000Z","updated_at":"2024-04-17T22:24:09.959Z","dependencies_parsed_at":"2023-10-19T23:20:50.140Z","dependency_job_id":"bf97a222-231f-44dc-835d-66c7699dc001","html_url":"https://github.com/localnerve/grunt-html-snapshots","commit_stats":{"total_commits":82,"total_committers":6,"mean_commits":"13.666666666666666","dds":"0.35365853658536583","last_synced_commit":"e1411e9f04ffffd83c9604e9de05b2969b1ebf16"},"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localnerve%2Fgrunt-html-snapshots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localnerve%2Fgrunt-html-snapshots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localnerve%2Fgrunt-html-snapshots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localnerve%2Fgrunt-html-snapshots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localnerve","download_url":"https://codeload.github.com/localnerve/grunt-html-snapshots/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245090894,"owners_count":20559296,"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":["grunt-task","html-snapshots"],"created_at":"2024-10-14T11:15:35.930Z","updated_at":"2025-03-23T10:41:37.521Z","avatar_url":"https://github.com/localnerve.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-html-snapshots\n\n[![npm version](https://badge.fury.io/js/grunt-html-snapshots.svg)](http://badge.fury.io/js/grunt-html-snapshots)\n![Verify](https://github.com/localnerve/grunt-html-snapshots/workflows/Verify/badge.svg)\n\n\u003e The grunt task for [html-snapshots](http://github.com/localnerve/html-snapshots)\n\n## Getting Started\nThis plugin requires Grunt `\u003e=1.0.0`  \n*To use an older Grunt, use this library at tag `#v1.0.2`*\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-html-snapshots --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-html-snapshots');\n```\n\n## The \"html_snapshots\" task\n\n### Overview\nThis is a simple grunt task that uses the [html-snapshots](http://github.com/localnerve/html-snapshots) library. In your project's Gruntfile, add a section named `html_snapshots` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  html_snapshots: {\n    options: {\n      // Task-specific options go here.\n    },\n    your_target: {\n      options: {\n        // Target-specific options go here.\n      }\n    },\n  },\n})\n```\n\n### Options\n\n#### options.force\nType: `boolean`\nDefault value: `false`\n\nA boolean value that is used to force the Gruntfile to continue, even if this task fails.\n\n#### MORE\nFor details of task and target specific options, read the options section of [html-snapshots](http://github.com/localnerve/html-snapshots)\n\n### Usage Examples\n\n#### Default Options and Targets\nIn this example, the default options are used to specify that the output directory should always be cleaned prior to taking snapshots, that a local robots.txt file should be used, and the html should be served from localhost. On all pages except the home page, when the selector \"#dynamic-content\" appears in the output, the page is ready for a snapshot. On the home page, we only take the snapshot when the selector \"#home-content\" is visible in the output.\n\n```js\ngrunt.initConfig({\n  html_snapshots: {\n    // options for all targets\n    options: {\n      source: \"/path/to/local/robots.txt\",\n      hostname: \"localhost\",\n      selector: { \"__default\": \"#dynamic-content\", \"/\": \"#home-content\" },\n      outputDirClean: \"true\",\n    },\n    // the debug target\n    debug: {\n      options: {\n        outputDir: \"./snapshots/debug\"\n      }\n    },\n    // the release target\n    release: {\n      options: {\n        outputDir: \"./snapshots/release\"\n      }\n    }\n  }\n});\n\ngrunt.loadNpmTasks('grunt-html-snapshots');\n\ngrunt.registerTask('debug', ['html_snapshots:debug']);\ngrunt.registerTask('release', ['html_snapshots:release']);\n```\n\nMany more options are available. For details and examples of using the html-snapshots options, visit [html-snapshots](http://github.com/localnerve/html-snapshots).\n\n## Contributing\nIn lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## License\n[MIT License](LICENSE.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalnerve%2Fgrunt-html-snapshots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalnerve%2Fgrunt-html-snapshots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalnerve%2Fgrunt-html-snapshots/lists"}