{"_id":"@crush-pics/crush-pics","_rev":"4-82b05757afec5cdd2bc14ed88eff16f8","name":"@crush-pics/crush-pics","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@crush-pics/crush-pics","version":"0.1.0","main":"dist/crush-pics.js","homepage":"https://github.com/crush-pics/crush-pics-node","dependencies":{"q":">=1.0.1"},"keywords":["crush.pics","compression","optimisation"],"repository":{"type":"git","url":"git+https://github.com/crush-pics/crush-pics-node.git"},"directories":{"dist":"./dist"},"author":"","license":"MIT","bugs":{"url":"https://github.com/crush-pics/crush-pics-node/issues"},"description":"","gitHead":"12fdefb04a77a5fa2da375bec0bf2b459434b714","_id":"@crush-pics/crush-pics@0.1.0","_nodeVersion":"12.10.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-2L1viep5gdl5hpenbknMQIDO79B8iCKH7jJ1KDSwb4CR3OJNGvRkNunH9LIfmiRpEvIkjT2jSQ3xk2/86b2fbw==","shasum":"e9af0ee27035daffae8cf254ade04f4b97504708","tarball":"https://registry.npmjs.org/@crush-pics/crush-pics/-/crush-pics-0.1.0.tgz","fileCount":2,"unpackedSize":15149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlMH6CRA9TVsSAnZWagAAraUQAJlHlYa6K0/DbAJZKXTS\nKYOYjehytDzG8qt2VL2mtSDit9XYS6Yrg4DjfHpyZNJgDDDGziByb4c7uRH6\nn4EOfv+biH3hJTDxc8WzFsMI2TI7VHsKjZ7oIXdkcGPKAKDeCHoSZhku6QJ4\nNDxGqTQiTmSd8Vbd8kQR5/XcXMggX4I1XQshlwVdj0SZZoImH2Qt+1iYvBvU\ntNulI2yg8hzxduGJRWKLVlnTnefqlpaVEwCe1ZLoyRG3z8EY2yOq1TVSYLbW\nlGZGmDFaVOS9RhHXtbA0b80UhkHehNmAr13IMVtPLDBPfvJGKbUtj6G22z6g\nCR7I6/oeqRQMZQFBT2O9/y6gfHFoi2XDQI/DgRNytVwDQ8tDRIibTaicHzoS\nZloWQ4wu3/T03jMf/5vdK6T0oosYlJ8zGxMLkWl+AHq+avedV84xmBPjnkue\nJ6Zin7cg2W9zjNsLbETo4Fac3aReZb86UV6qfLiKqSDgt+bjX369tZiSG24b\ncq6NCovdjsLReEuwFgHdjkLNJNbu69uwlz+k3921hA8CwF10vxBs00PHFVZc\nRhCgLQj4cW2o2O1R64hjwyQ5r7QQ3Vaimzl0ja/CXgWxoV8iL5X0VLJh5UbE\nCee5SiHHbx3rG5BGNk6keWD44cvesD751Wb7TBEZ28W/XBLwf7sSO6n/7GEA\nNN0h\r\n=SNUR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDR9/4/Sp5cY6/fpgVDzvL3tEbgJMe+QThhXKXC58oSvwIgJPASvD1fTvTiBwWD4Kez+d5YM+2PlwA21TIBSCcTA/g="}]},"maintainers":[{"name":"m0n9oose","email":"m0n9oose@gmail.com"},{"name":"domagojb","email":"hi@spacesquirrel.co"}],"_npmUser":{"name":"m0n9oose","email":"m0n9oose@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crush-pics_0.1.0_1570030074065_0.3811756087657774"},"_hasShrinkwrap":false},"0.2.0":{"name":"@crush-pics/crush-pics","version":"0.2.0","main":"dist/crush-pics.js","homepage":"https://github.com/crush-pics/crush-pics-node","dependencies":{"q":">=1.0.1"},"keywords":["crush.pics","compression","optimisation"],"repository":{"type":"git","url":"git+https://github.com/crush-pics/crush-pics-node.git"},"directories":{"dist":"./dist"},"author":"","license":"MIT","bugs":{"url":"https://github.com/crush-pics/crush-pics-node/issues"},"description":"","gitHead":"52fd00aadf5a672838b37d3cbe5aebd55a834b0e","_id":"@crush-pics/crush-pics@0.2.0","_nodeVersion":"12.10.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-fGP7C0hGsBtPHf34lBHSvXMwRPaIq9TRzGPzoyQVlnipAoMIPnuuUX5rLzSOJQeRKQNjiYOQf2klbb0Z3LW/Ow==","shasum":"af2d165fee86c6c6e75fd65c6d44ad78c8fbd894","tarball":"https://registry.npmjs.org/@crush-pics/crush-pics/-/crush-pics-0.2.0.tgz","fileCount":2,"unpackedSize":12794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdledgCRA9TVsSAnZWagAACOUP/jQoDpGVj7SB7V7YM1xZ\nc9uyQ7xan63oVhkWvGL8ERQDupxsaGSWWzR7QjMTgZu6l2CgnAmiap4RJDeD\neOrSQAwhLsKqrcRmSil4Gu3L/9vgEOPs0Oq6/FqxFPBXDDZK+dALDibYkm0T\nFyuYF0Jsdog9uyAq7KEKPV2vZeNL3tN5kBwTznzWX8x7D33mvUmFykX/Cd17\nGq2ju1XpgXBm6VkqPQ5/KE59B2xjuWBoUarMWvqv6YWfNLx52zvh8TPNBxV8\nGBmrGmnGyG9CfD1jYvV2W54eQ76448RbJI5LWxH53BZIldbxV/gmzplhhtu4\nCi4ArgMagNJ8ED00ayWMD8KRsutd8x76LxG0cisi35wA7BmMKq5G666Xu3Du\nO9pU+SfOgDGkJE+s+yDyiWm1FAVZ35d8xQk9f7dH2zeImOt1h9eUXSoQ35QX\n51ZxrI68Xx++uWa/5ZDLnULEAu3zZPje2hWBdcV40OK5WxvBFHnqeuj4jZkI\n/Q9j3h+bfs7zqyJiIcD9V0eRIWP5Pzd3PhTvhvK+/rvW6azcdTuC9m0SUWrj\nv3l1YqNl7PikfvPXqp4aJm+sL58gKlDYfEbHN+WVjrL5ZMtly7qKuHdE+gFd\nlr/em8VtalH0v9umc47dwuSn559vf3XrKvDlqEFu5kGOm2KuuC7puNoKwvND\nAilR\r\n=+lJt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQlLFMwAjRDJdPYLOd6/NtLTYxwh6pn9vtshL9Sf4U3wIgdg5+l3ild0tnqmlT6Mu8pkOy7eeZZN4A7Z0/Sosqm8w="}]},"maintainers":[{"name":"domagojb","email":"hi@spacesquirrel.co"},{"name":"m0n9oose","email":"m0n9oose@gmail.com"}],"_npmUser":{"name":"m0n9oose","email":"m0n9oose@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crush-pics_0.2.0_1570105183911_0.3681433198215782"},"_hasShrinkwrap":false},"0.2.1":{"name":"@crush-pics/crush-pics","version":"0.2.1","description":"Crush.pics NodeJS Module","main":"index.js","homepage":"https://github.com/crush-pics/crush-pics-node","scripts":{"dev":"node index.js","app":"node app.js","test":"echo \"Error: no test specified\" && exit 1"},"keywords":["crush.pics","compression","optimisation"],"author":{"name":"Crush.pics Dev Team"},"license":"MIT","bugs":{"url":"https://github.com/crush-pics/crush-pics-node/issues"},"dependencies":{"axios":"^0.19.0","form-data":"^2.5.1"},"gitHead":"8a95300e29839f223f000efb49f4f46998489a59","_id":"@crush-pics/crush-pics@0.2.1","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-mBkbV+J9+W3m4R+VkMd8crbGLd4BcONYdTa7qP2TVl9e0SUZNBXTcxq+jZWZFHcRLTr4z3PqXklZ+gTLi5I59w==","shasum":"0b08b20fb884d657fb3001452939d719a59e0219","tarball":"https://registry.npmjs.org/@crush-pics/crush-pics/-/crush-pics-0.2.1.tgz","fileCount":23,"unpackedSize":93298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdrv8rCRA9TVsSAnZWagAAslUP/iH9nrnZyOcB/P8N+yjk\nt2S3kXk8S0eH7zou546KVIoiR+PrYLvzgNvOHPxjTiT+s4wXAkwNbqdL/4gp\n7M/hS51br/PpDCfYxSgycbIr2NYV43LlTOD3QNQfQmtqs5t6OcAyo6EAroB2\n8fQmpBV3kN+MZyppHZfyTHQAc97Y5Rt0IXxkvXY6U3tThzDKDIATZBkaf0vV\ntpC0PpOEbYjLkAX0tZlntVbK7xzfrG21NQnbNjfrNS8TMe4TAJlxpADAOXuG\nNKy7qcljpQ6cnmPQmW+Lsj+ddSm74CVedJDKKP4SDz/jY6jnny/hwSkSew5z\niUiNTGn8dEujYFhDgrVuu01GCcq7MipbE5yNW+poXmy0aIL7fpmFVfsR6sLQ\nmFPewsoPXLWXOhTVjNcS9rEaNsXrvBAgQtJENi82x2pMiR8nhC/W/QiEBVQs\n7xc4NTqVol/QVf7kMOJzFI/svDOR17ubF9WoYW0HOHJZ4VyxUJNQ8x6+JaoV\n0sfGyZFxh5uRpcwLH/2QirG5YSwnCkmPxsO9b/FE1QhIQKrlfFQFqGEPNj/l\nkm1A8zzljDMbo0RnRh+hxEXb9KMM4Xf8PelfFBHujlV0W4SZYLLynpiUMw0W\npsjx0MwQFraqfj1VBlxmgWyqV5x3oqIe06SaLmaSMs3tx7Q7UgYQ9lySrJ32\npcT/\r\n=dKst\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoPXe0vW78MiIbx5TMKjLx2TpP+cwCyKWmvrRO+CKDpQIgDKlPRw3L1ZrnzmPnnjAfg3NQ752CTPd1KdCMYcVQd0k="}]},"maintainers":[{"name":"domagojb","email":"hi@spacesquirrel.co"},{"name":"m0n9oose","email":"m0n9oose@gmail.com"}],"_npmUser":{"name":"m0n9oose","email":"m0n9oose@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crush-pics_0.2.1_1571749675172_0.39720796246849877"},"_hasShrinkwrap":false},"0.2.2":{"name":"@crush-pics/crush-pics","version":"0.2.2","description":"Crush.pics NodeJS Module","main":"index.js","homepage":"https://github.com/crush-pics/crush-pics-node","scripts":{"dev":"node index.js","app":"node app.js","test":"echo \"Error: no test specified\" && exit 1"},"keywords":["crush.pics","compression","optimisation"],"author":{"name":"Crush.pics Dev Team"},"license":"MIT","bugs":{"url":"https://github.com/crush-pics/crush-pics-node/issues"},"dependencies":{"axios":"^0.19.0","form-data":"^2.5.1"},"gitHead":"b3178f8136fff181d3408a4ae8edb6f4819a131f","_id":"@crush-pics/crush-pics@0.2.2","_nodeVersion":"13.5.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Hz0MlASIRhC0GqiRm8m7PCIwz3tkjm0eJBLl8bsqFwQ6AAIOnHZX6lJV4siqO9tMa7HU/wTg0+9HaOrb96LuXw==","shasum":"809b1ab4af6189e161351d7b1bfa9f4d49351b2f","tarball":"https://registry.npmjs.org/@crush-pics/crush-pics/-/crush-pics-0.2.2.tgz","fileCount":22,"unpackedSize":95390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFcDZCRA9TVsSAnZWagAAx0MP/RBq4BxIKJBRGZhQft5Y\nBV3eHmyF/dZvtz7FvJKIm1HhfUhnGY79yTWJezSQ8s88ydaIjyhQyjV+jmns\nQCKuGQDdRrk8F7J6IaV9EDoB175BHmVTPbnQDTCe88hRu+j3a10d5XDaKrtr\nw0Ba+tp7oEBtaxrUWVDjWon4G2lwmz/3hFri8ouJWznLsHHj2uHbWnPngm/o\n3+F826oDm7yc1l1K0dDrF5HXvaGzqObk9+wuG7FqZIebhI28wYI20WJZ5/2d\nm5WpjV4cu2bWG2kBPnpDfPuQhTgBOn2hnMekGYD8VMYbHc37XuKEyQ+n2aLh\niqOGVSj9+G5TsUUcuUh0sOzn6iZDMT9r2e7HhpckiVxlvy2mCne6NLRaP5Db\nCtV+CkFu3F9WQC0/AxDaSJLXk2ikkBdP8+Riworo5VFVDfbLdNzu6mb4g8t9\njFH5CfyP9mXOOywElsUBe/DjPJHBdMwAOEzUyhjLSpR4guPOvEX9I1NtLhAi\n3IXiMJzwOFqMMm9SApEmQfQO2Qyvy5QbGyKnAH//YCZP7MoeWXmP5YnO5noL\nS+zpGWVruv1HVbsryoGVvU6Qomjb27n+GZimtu+2GhWJ1Ds4m8HRCzjCpdxR\n0nWbqPgCCTGyx9xV9HnrMaYK/RnqGpNYdkG8Vtv6DVuaTTfRcXjaXbHrkRmP\nzhR2\r\n=3J4f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIesVhpU3KoT3O/QLpkUsmAT9EQz5TpHvzfTkfQlKu7gIhAMPdSDttRNHiwb2iSQBffI07EO1qHM8CVOCENboUDQOZ"}]},"maintainers":[{"name":"domagojb","email":"hi@spacesquirrel.co"},{"name":"m0n9oose","email":"m0n9oose@gmail.com"}],"_npmUser":{"name":"m0n9oose","email":"m0n9oose@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crush-pics_0.2.2_1578483928510_0.8563377825152636"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-02T15:27:53.842Z","0.1.0":"2019-10-02T15:27:54.198Z","modified":"2022-04-05T01:57:55.344Z","0.2.0":"2019-10-03T12:19:44.008Z","0.2.1":"2019-10-22T13:07:55.388Z","0.2.2":"2020-01-08T11:45:28.665Z"},"maintainers":[{"name":"domagojb","email":"hi@spacesquirrel.co"},{"name":"m0n9oose","email":"m0n9oose@gmail.com"}],"homepage":"https://github.com/crush-pics/crush-pics-node","keywords":["crush.pics","compression","optimisation"],"bugs":{"url":"https://github.com/crush-pics/crush-pics-node/issues"},"license":"MIT","readme":"# Crush.pics Node Client Library\n\nThis is the [node.js](http://nodejs.org/) Library for integrating with Crush.pics API. Sign up for a Crush.pics account [here](https://app.crush.pics).\n\n## Installation\n\nInstall the latest version of the library with the following command:\n\n```\n$ npm i @crush-pics/crush-pics\n```\n\nThen require the library:\n\n```\nvar CrushPics = require('@crush-pics/crush-pics');\n```\n\n## Documentation\n\nThe full documentation can be found [here](https://docs.crush.pics)\n\n## Get started\n\nIn order to perform API calls you need to configure your client - provide your private API token:\n\n```javascript\nvar CrushPics = require('@crush-pics/crush-pics');\n\nCrushPics.configure({\n  api_token: '<your API key>'\n});\n\n```\n\n#### Dashboard\n\nGet information about your account and quota consumption report\n\n```javascript\nvar type = 'week'; # also supports 'month' & 'six_months'\n\nCrushPics.dashboard.get({ report_type: type }).then(function(response) {\n  console.log(response);\n});\n```\n\nConsumption report comes in [ApexCharts.js](https://apexcharts.com/) compatible format.\n\nExample:\n\n```javascript\nvar renderChart = function(data) {\n  // ApexCharts.js initialization options\n  var options = {\n    chart: {\n      height: 350,\n      width: '100%',\n      type: 'bar',\n      stacked: true,\n    }\n  }\n  var report = data.stats.consumption;\n  var values = $.map(report.series, function(p, k) {\n    return p\n  });\n  \n  options.series = $.map(report.series, function(v, k) {\n    return {\n      name: window.i18n.origins[k], // customize labels\n      data: v\n    }\n  });\n  \n  options.xaxis.categories = report.columns;\n\n  var chart = new ApexCharts(\n    document.querySelector(\"#consumption-chart\"),\n    options\n  );\n\n  chart.render();\n}\n\nCrushPics.dashboard.get({ report_type: 'week' }).then(function(response) {\n  renderChart(result.data);\n});\n```\n\n#### Async compression\n\nYou can send you an image to compression by uploading actual blob or just providing a link to the file\n\n```javascript\nCrushPics.original_images\n  .create({\n    image_url: 'https://example.com/image.jpeg',\n    compression_type: 'balanced',\n  })\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n```javascript\nvar file = input.files[0]\n\nCrushPics.original_images\n  .create({\n    file: file,\n    compression_type: 'balanced',\n  })\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n#### Sync compression\n\nYou can send you an image to compression by uploading actual blob or just providing a link to the file\n\n```javascript\nCrushPics.original_images\n  .compress({\n    image_url: 'https://example.com/image.jpeg',\n    compression_type: 'balanced',\n  })\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n```javascript\nvar file = input.files[0]\n\nCrushPics.original_images\n  .compress({\n    file: file,\n    compression_type: 'balanced',\n  })\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n#### List uploaded images\n\n```javascript\nCrushPics.original_images\n  .list()\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n#### Get details of uploaded image\n\n```javascript\nCrushPics.original_images\n  .get(11)\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n#### Get account details\n\n```javascript\nCrushPics.account\n  .get()\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n#### Update account details\n\nYou can change your account details including default compression settings\n\n```javascript\nCrushPics.original_images\n  .update({\n    compression_level_jpg: 70,\n    compression_level_png: 70,\n    compression_level_gif: 70,\n    compression_type: 'balanced'\n  })\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n#### List Callback URLs\n\n```javascript\nCrushPics.callback_urls\n  .list()\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n#### Create Callback URL\n\nYou can change your account details including default compression settings\n\n```javascript\nCrushPics.callback_urls\n  .create({\n    url: 'https://example.com/webhook'\n  })\n  .then(function(response) {\n    console.log(response);\n  });\n```\n\n#### Delete Callback URL\n\nYou can change your account details including default compression settings\n\n```javascript\nCrushPics.callback_urls\n  .delete(12)\n  .then(function(response) {\n    console.log(response);\n  });\n```\n","readmeFilename":"README.md","description":"Crush.pics NodeJS Module","author":{"name":"Crush.pics Dev Team"}}