{"id":20331042,"url":"https://github.com/tgallacher/kraken-loader","last_synced_at":"2026-05-16T08:02:37.036Z","repository":{"id":97479019,"uuid":"91958939","full_name":"tgallacher/kraken-loader","owner":"tgallacher","description":"Kraken.io image optimisation loader for Webpack 2+","archived":false,"fork":false,"pushed_at":"2018-03-22T21:32:46.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-28T00:04:21.795Z","etag":null,"topics":["image-processing","kraken","kraken-loader","optimization","webpack"],"latest_commit_sha":null,"homepage":"https://www.npm.im/kraken-loader","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/tgallacher.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}},"created_at":"2017-05-21T13:24:33.000Z","updated_at":"2019-12-03T13:57:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"b29eb2f4-8564-4ca5-bba6-056702e13aef","html_url":"https://github.com/tgallacher/kraken-loader","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"2a4f25ba8f896d6b673cb70b5b7efd7d2b8bbd33"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgallacher%2Fkraken-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgallacher%2Fkraken-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgallacher%2Fkraken-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgallacher%2Fkraken-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tgallacher","download_url":"https://codeload.github.com/tgallacher/kraken-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241846060,"owners_count":20029994,"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":["image-processing","kraken","kraken-loader","optimization","webpack"],"created_at":"2024-11-14T20:18:34.208Z","updated_at":"2025-10-03T19:27:42.300Z","avatar_url":"https://github.com/tgallacher.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"kraken-loader\n===========\n\nImage optmization loader for Webpack 2+ using [Kraken.io](https://kraken.io).\n\n\u003c!-- MarkdownTOC --\u003e\n\n1. [Installation](#installation)\n1. [Options](#options)\n1. [Usage](#usage)\n1. [Acknowledgements](#acknowledgements)\n1. [LICENSE - MIT](#license---mit)\n\n\u003c!-- /MarkdownTOC --\u003e\n\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\n\n````\n$ npm i -D kraken-loader\n````\n\n\u003ca name=\"options\"\u003e\u003c/a\u003e\n## Options\n\nThe loader supports the following options:\n\n* `key` - your Kraken API Key\n* `secret` - your Kraken API Secret\n* `lossy` - enable/disable intelligent lossy optimization. Defaults to `true`\n* `enabled` - enable/disable optimization using this loader. Defaults to `true`\n* `silent` - enable/disable byte savings message. Defaults to `false`\n\nThe loader also supports supplying your API credentials using the following environment variables:\n* `KRAKEN_LOADER_KEY` - Kraken API Key\n* `KRAKEN_LOADER_SECRET` - Kraken API Secret\n\nThe environment variables offer a way to supply your API credentials without having to commit them to your VCS. This is the recommended method for supplying your Kraken.io API credentials.\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\n\nIt is expected that this plugin will be used alongside the [url-loader](https://github.com/webpack/url-loader), [file-loader](https://github.com/webpack/file-loader), or [raw-loader](https://github.com/webpack/raw-loader).\n\n\n### Use with loader defaults\nThe following example requires your API credentials to be supplied using the supported environment variables (see [Options](#options)).\n\n````js\nmodule.exports = {\n    ...\n    module: {\n        rules: [\n            {\n                test: /\\.(jpe?g|png|gif|svg)$/i,\n                use: [\n                    {\n                        loader: 'file-loader',\n                        options: {\n                            name: 'images/[name].[ext]'\n                        }\n                    },\n                    'kraken-loader'\n                ]\n            }\n        ],\n    }\n}\n````\n\n### Customising the loader config\n```js\nmodule.exports = {\n    ...\n    module: {\n        rules: [\n            {\n                test: /\\.(jpe?g|png|gif|svg)$/i,\n                use: [\n                    {\n                        loader: 'file-loader',\n                        options: {\n                            name: 'images/[name].[ext]'\n                        }\n                    },\n                    {\n                        loader: 'kraken-loader',\n                        options: {\n                            enabled: process.env.NODE_ENV === 'production',\n                            secret: 'my-api-secret',\n                            silent: true,\n                            lossy: true,\n                            key: 'my-api-key'\n                        }\n                    }\n                ]\n            }\n        ]\n    }\n}\n```\n\nSupplying your API credentials in the options object is optional. The options object can be used alongside the environment variables for specifying API credentials.\n\n\u003ca name=\"acknowledgements\"\u003e\u003c/a\u003e\n## Acknowledgements\n\nThis plugin was inspired by the [gulp-kraken](https://github.com/kraken-io/gulp-kraken) plugin.\n\n\u003ca name=\"license---mit\"\u003e\u003c/a\u003e\n## LICENSE - MIT\nSee [LICENSE](/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgallacher%2Fkraken-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftgallacher%2Fkraken-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgallacher%2Fkraken-loader/lists"}