{"_id":"node-image-resizer","_rev":"1-f14487ee8d7ab7f4ccde9d439db88d60","name":"node-image-resizer","description":"Get image and generate its smaller copies asynchronously.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"node-image-resizer","version":"1.0.0","description":"Get image and generate its smaller copies asynchronously.","main":"index.js","dependencies":{"image-size":"0.6.1","jimp":"0.2.28"},"devDependencies":{"babel-jest":"21.2.0","babel-plugin-rewire":"1.1.0","babel-plugin-transform-runtime":"6.23.0","babel-preset-env":"1.6.0","babel-preset-stage-2":"6.24.1","eslint":"4.8.0","eslint-config-airbnb-base":"12.0.2","eslint-plugin-import":"2.7.0","eslint-plugin-smells":"1.0.1","eslint-plugin-unicorn":"2.1.2","jest":"21.2.1"},"scripts":{"lint":"eslint .","test":"npm run lint && npm run unit","unit":"jest --config jest.config.json"},"engines":{"node":">=7.6.0","npm":">=4.0.0"},"keywords":["image","thumbnail","resize"],"repository":{"type":"git","url":"git+https://github.com/jacekwasowski/node-image-resizer.git"},"author":{"name":"Jacek Wasowski"},"license":"MIT","gitHead":"4e2b99749a43d68440822193308c8bc79a5e081c","bugs":{"url":"https://github.com/jacekwasowski/node-image-resizer/issues"},"homepage":"https://github.com/jacekwasowski/node-image-resizer#readme","_id":"node-image-resizer@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.4.0","_npmUser":{"name":"jacek.wasowski","email":"jacek.wasowski@yahoo.com"},"dist":{"integrity":"sha512-wLGeSoB0J4QN1/hyjeJP7oRzEjFHAr7DOBrCyilqrUracqwkZ4oZ5Qt+3KNpQ6f50MHafXW6SY0xXmTncp7Oww==","shasum":"922a0835873051e39914b39c54ff9ff1cc86af20","tarball":"https://registry.npmjs.org/node-image-resizer/-/node-image-resizer-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6oGw68yxpWUii6abTFamP3S8hZXX4Kif+THqRvwm77AIgIMfihFPC/DwZAtjZHqNjS/TuQ1QJqgaZEAITt4ZHOqc="}]},"maintainers":[{"name":"jacek.wasowski","email":"jacek.wasowski@yahoo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-image-resizer-1.0.0.tgz_1507660649306_0.7158990933094174"}}},"readme":"# node-image-resizer\n> Get some image and generate its smaller copies. \nYou can also control the quality, brightness and contrast. Asynchronously.\n\n\n## Installation\n```sh\nnpm i -D node-image-resizer\n```\n\n## Usage\n```javascript\nimport resizer from 'node-image-resizer';\n\n(async () => {\n  await resizer('./image.jpg', setup);\n})();\n```\nReturns array of file names (with path) for generated thumbnails.\n\n\n## Setup\nYou can create as many thumbnails from your image as you wish. \n\nAll definitions (for each thumbnail separately) are grouped in one object with following structure:\n\n```javascript\nconst setup = { \n  all: {},                 // general settings to apply on each thumbnail\n  versions: [{}, {}, {}]   // unique settings for each thumbnail; will overwrite general setting\n};\n```\n\nfor example:\n```javascript\nconst setup = { \n  all: {\n    path: './thumbnails/',\n    quality: 80\n  },\n  versions: [{\n    prefix: 'big_',\n    width: 1024,\n    height: 768\n  }, {\n    prefix: 'medium_',\n    width: 512,\n    height: 256\n  }, {\n    quality: 100,\n    prefix: 'small_',\n    width: 128,\n    height: 64\n  }]\n};\n\n// create thumbnails\nconst thumbs = await resizer('./image.jpg', setup);\n```\nSettings from `versions` overwrite values from `all`.\n\n\n## Options\nAll options are optional.\n\nname | type | default | description\n---|---|---|---\npath | string |  | Destination path for generated image.\nprefix | string |  | Used to create file name based on source file name. Will overwrite a file with the same name if exists. \nsuffix | string |  | Used to create file name based on source file name. Will overwrite a file with the same name if exists.\nwidth | number | source image width | Width of the new image (in px).\nheight | number | source image height | Height of the new image (in px).\ncontrast | number |  | Adjust the contrast by a value -1 to +1.\nbrightness | number |  | Adjust the brightness by a value -1 to +1.\nquality | number |  | Set the quality of saved JPEG by a value 0 - 100.\nnormalize | boolean | false | Normalize the channels in the new image.\n\n\n## License\n\nMIT","maintainers":[{"name":"jacek.wasowski","email":"jacek.wasowski@yahoo.com"}],"time":{"modified":"2022-05-11T01:16:38.455Z","created":"2017-10-10T18:37:32.090Z","1.0.0":"2017-10-10T18:37:32.090Z"},"homepage":"https://github.com/jacekwasowski/node-image-resizer#readme","keywords":["image","thumbnail","resize"],"repository":{"type":"git","url":"git+https://github.com/jacekwasowski/node-image-resizer.git"},"author":{"name":"Jacek Wasowski"},"bugs":{"url":"https://github.com/jacekwasowski/node-image-resizer/issues"},"license":"MIT","readmeFilename":"README.md"}