{"_id":"node-smushit","_rev":"386232","name":"node-smushit","description":"node-smushit\r =====","dist-tags":{"latest":"0.5.1"},"maintainers":[{"name":"colorhook","email":"colorhook@gmail.com"}],"time":{"modified":"2024-06-18T14:52:21.000Z","created":"2012-04-02T19:19:27.588Z","0.5.1":"2013-01-23T11:43:50.416Z","0.5.0":"2013-01-17T06:12:09.380Z","0.4.0":"2012-11-05T02:45:04.842Z","0.3.0":"2012-06-26T12:17:29.609Z","0.2.0":"2012-06-18T03:51:01.838Z","0.1.0":"2012-04-02T19:19:27.588Z"},"users":{"gazzwi86":true},"author":{"name":"colorhook","email":"colorhook@gmail.com"},"repository":{"type":"git","url":"http://github.com/colorhook/node-smushit"},"versions":{"0.5.1":{"name":"node-smushit","version":"0.5.1","author":{"name":"colorhook","email":"colorhook@gmail.com"},"repository":{"type":"git","url":"http://github.com/colorhook/node-smushit"},"dependencies":{"optimist":">= 0.2.6"},"devDependencies":{"nodeunit":"~>0.6.4"},"keywords":["image","compressor","compression"],"directories":{"lib":"./lib"},"bin":{"smushit":"./cli.js"},"main":"smushit","engines":{"node":">= 0.8.0"},"licenses":[{"type":"BSD","url":"LICENSE"}],"_id":"node-smushit@0.5.1","description":"node-smushit\r =====","dist":{"shasum":"4bb58e148810cf2375a1b2c80f069db9db5bb508","tarball":"http://registry-npm.ywwl.com/node-smushit/download/node-smushit-0.5.1.tgz","integrity":"sha512-3Cukdzk/2VsIyKLR1UGsPbW1Zs+E9dtEpWMtsMR8tR4Tp7OWhzDAOPokv++j48zS/5ODwY05c1f8ZPTkDD6OyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAx9DIPpjS/5vy8TgFiHLkiIjgT8tDApYBxqeIuP438/AiEAnWpMp0rCRotKyj2H5Yt5JQ+XlH2ebMg5h16IEbx9Q2I="}],"size":5446,"noattachment":false,"key":"/node-smushit/-/node-smushit-0.5.1.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"colorhook","email":"colorhook@gmail.com"},"maintainers":[{"name":"colorhook","email":"colorhook@gmail.com"}],"publish_time":1358941430416,"_cnpm_publish_time":1358941430416},"0.5.0":{"name":"node-smushit","version":"0.5.0","author":{"name":"colorhook","email":"colorhook@gmail.com"},"repository":{"type":"git","url":"http://github.com/colorhook/node-smushit"},"dependencies":{"optimist":">= 0.2.6"},"devDependencies":{"nodeunit":"~>0.6.4"},"keywords":["image","compressor","compression"],"directories":{"lib":"./lib"},"bin":{"smushit":"./cli.js"},"main":"smushit","engines":{"node":">= 0.8.0"},"licenses":[{"type":"BSD","url":"LICENSE"}],"_id":"node-smushit@0.5.0","description":"node-smushit\r =====","dist":{"shasum":"ef1d323c5f4d688d9ca28abcc3fc9f88790fb5f7","tarball":"http://registry-npm.ywwl.com/node-smushit/download/node-smushit-0.5.0.tgz","integrity":"sha512-5t7HSAlDGPEFerV/PfHa5A9swXRA4IOU7UEGuRNLkdvKtSNfmNdE69CRmqE/iL3SyWu8KfeInPQIUiepS5z8bw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSu6eqJqkyJMFWWIQET5NwKdu2DIWOx3uLxfIi/fCDuAiB5CDzc616CvpEPhTFxSZj5vWXq2n2QQvp2TNoZbMD/Hw=="}],"size":5353,"noattachment":false,"key":"/node-smushit/-/node-smushit-0.5.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"colorhook","email":"colorhook@gmail.com"},"maintainers":[{"name":"colorhook","email":"colorhook@gmail.com"}],"publish_time":1358403129380,"_cnpm_publish_time":1358403129380},"0.4.0":{"name":"node-smushit","version":"0.4.0","author":{"name":"colorhook","email":"colorhook@gmail.com"},"repository":{"type":"git","url":"http://github.com/colorhook/node-smushit"},"dependencies":{"optimist":">= 0.2.6"},"devDependencies":{"nodeunit":"~>0.6.4"},"keywords":["image","compressor","compression"],"directories":{"lib":"./lib"},"bin":{"smushit":"./cli.js"},"main":"smushit","engines":{"node":">= 0.8.0"},"licenses":[{"type":"BSD","url":"LICENSE"}],"_id":"node-smushit@0.4.0","description":"node-smushit\r =====","dist":{"shasum":"374cb51bcfe177b367b582222c40ff44bba63820","tarball":"http://registry-npm.ywwl.com/node-smushit/download/node-smushit-0.4.0.tgz","integrity":"sha512-OkB6y7PvVSUVOn1ByGMfNOnC77CIvODFgcP1LsOVh+ruEjh9U7dZjWRHZTqoYc7erbuiKfnh8P9+xc8nvnCoTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICwRb44Y92d5DocB5uitsOPR8T9dplmTBfk5rv7NFTN8AiEA8714Q/DWLwM3pjAP6ew0Ub+snz1L+3MwU2YQW21MXGg="}],"size":5304,"noattachment":false,"key":"/node-smushit/-/node-smushit-0.4.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"colorhook","email":"colorhook@gmail.com"},"maintainers":[{"name":"colorhook","email":"colorhook@gmail.com"}],"publish_time":1352083504842,"_cnpm_publish_time":1352083504842},"0.3.0":{"name":"node-smushit","version":"0.3.0","author":{"name":"colorhook","email":"colorhook@gmail.com"},"repository":{"type":"git","url":"git://github.com/colorhook/node-smushit.git"},"dependencies":{"optimist":">= 0.2.6"},"devDependencies":{"nodeunit":"~>0.6.4"},"keywords":["image","compressor","compression"],"directories":{"lib":"./lib"},"bin":{"smushit":"./cli.js"},"main":"smushit","engines":{"node":">= 0.6.7"},"licenses":[{"type":"BSD","url":"LICENSE"}],"_npmUser":{"name":"colorhook","email":"colorhook@gmail.com"},"_id":"node-smushit@0.3.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"2f1eccd6824bf41fc7604ea8e3b498642fc2b3c6","tarball":"http://registry-npm.ywwl.com/node-smushit/download/node-smushit-0.3.0.tgz","integrity":"sha512-AzOnDzSE1gJuHW+hrESkssSIcf8hYw+xXYtl5tF9dpSiqB7V3xk6yQA7Zeuj9EF1DJVoN9XFF42YBOW6aUS6VQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUQUlBO6Pj9d+IT9BNNdK3T6mnCn+O4aN2F3JWUOioKAIhANqnL/5a0TCb8CCXnqJKXQYAqptZenBimEuZnbLxS65F"}],"size":5418,"noattachment":false,"key":"/node-smushit/-/node-smushit-0.3.0.tgz"},"maintainers":[{"name":"colorhook","email":"colorhook@gmail.com"}],"publish_time":1340713049609,"_cnpm_publish_time":1340713049609},"0.2.0":{"name":"node-smushit","version":"0.2.0","author":{"name":"colorhook","email":"colorhook@gmail.com"},"repository":{"type":"git","url":"git://github.com/colorhook/node-smushit.git"},"dependencies":{"optimist":">= 0.2.6"},"keywords":["image","compressor","compression"],"directories":{"lib":"./lib"},"bin":{"smushit":"./cli.js"},"main":"smushit","engines":{"node":">= 0.6.7"},"licenses":[{"type":"BSD","url":"LICENSE"}],"_npmUser":{"name":"colorhook","email":"colorhook@gmail.com"},"_id":"node-smushit@0.2.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"22871312c763cabc5e427d843322c4b6fbd16cbf","tarball":"http://registry-npm.ywwl.com/node-smushit/download/node-smushit-0.2.0.tgz","integrity":"sha512-B/wCUIf212vLqN9T7I6pusOSIWbW+2QbT9y04kQGx35W0ry55tE7tT3ahgvvNd82dhG3tuehzsvJV7PIesIf7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBUOKf3kAdfz5jhWdabmCnQ4toEujMJiVCFYdgAWqqD/AiAnMsVb3NeHbuuMYsO11c7PqXoj7BurASDxSLY7Vbs/+g=="}],"size":3916,"noattachment":false,"key":"/node-smushit/-/node-smushit-0.2.0.tgz"},"maintainers":[{"name":"colorhook","email":"colorhook@gmail.com"}],"publish_time":1339991461838,"_cnpm_publish_time":1339991461838},"0.1.0":{"name":"node-smushit","version":"0.1.0","author":{"name":"colorhook","email":"colorhook@gmail.com"},"repository":{"type":"git","url":"git://github.com/colorhook/node-smushit.git"},"dependencies":{"optimist":">= 0.2.6"},"keywords":["image","compressor","compression"],"directories":{"lib":"./lib"},"bin":{"smushit":"./cli.js"},"main":"smushit","engines":{"node":">= 0.6.7"},"licenses":[{"type":"BSD","url":"LICENSE"}],"_npmUser":{"name":"colorhook","email":"colorhook@gmail.com"},"_id":"node-smushit@0.1.0","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"77eecc97c4460ee6812951e37efa38a553099b2d","tarball":"http://registry-npm.ywwl.com/node-smushit/download/node-smushit-0.1.0.tgz","integrity":"sha512-h82UaDX6HLRFGzcKwjzdC3+FMIY6mnr8kmrtCaFA5q8gu2XhyjtIjiSs5F9DFClR7TAdQMNHcKqVLXzaeKup7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqZUZCFusnRkIYX71mvh4eLb9/f2g9VlqoNG/cnZK7HgIhAJQN6/XyccW1RD5Dpfqz6TdWMq+bccLhLqGsw/FTYYgd"}],"size":3763,"noattachment":false,"key":"/node-smushit/-/node-smushit-0.1.0.tgz"},"maintainers":[{"name":"colorhook","email":"colorhook@gmail.com"}],"publish_time":1333394367588,"_cnpm_publish_time":1333394367588}},"readme":"node-smushit\r\n=====\r\n\r\nusing smush.it service to optimize image(s) in node\r\n\r\nHow to use?\r\n------------\r\n\r\ninstall by NPM\r\n\r\n```shell\r\nnpm install node-smushit -g\r\n```\r\n\r\nuse smushit in shell\r\n\r\n```shell\r\n//view help\r\nsmushit -h\r\n\r\n//smash files or directory\r\nsmushit file1 file2 file3\r\n\r\n//with recursive\r\nsmushit file1 file2 file3 -R\r\n\r\n\r\n//smash file and save by new name\r\nsmushit image-file-name -o new-file-name\r\n\r\n\r\n/**\r\n * change the default service.\r\n * by default, `node-smushit` use the !Yahoo smushi.it service, you can create your owne smush service.\r\n * If you are in China, you will know how important to create your own smush.it service. \r\n * FUCK THE GFW & POOR NETWORK SPEED.\r\n */\r\n\r\n// view all config\r\nsmushit -c\r\n\r\n//view service endpoint config, indicate the smush.it HTTP service\r\nsmushit -c service\r\n\r\n//change the config\r\nsmushit -c service=http://your-own-service-endpoint/\r\n```\r\n\r\nuse it in node\r\n\r\n```javascript\r\nvar smushit = require('node-smushit');\r\n//smash a single file\r\nsmushit.smushit('images/need-to-smash.png');\r\n\r\n//smash files\r\nsmushit.smushit(['file1', 'fiel2', ..]);\r\n\r\n//smash images in directory\r\nsmushit.smushit('images-folder-path');\r\n\r\n//smash images in directory or the child-directories with recursive\r\nsmushit.smushit('images-folder-path', {recursive: true});\r\n\r\n//smash images and register callbacks\r\nsmushit.smushit('images-folder-path', {\r\n    onItemStart: function(item){\r\n\t\r\n    },\r\n    onItemComplete: function(e, item, response){\r\n\t\r\n    },\r\n    onComplete: function(reports){\r\n\t\r\n    },\r\n    service: 'http://my-custom-domain-service/'\r\n});\r\n```\r\n\r\nChangelog\r\n------------\r\n> v0.5.1\r\n* modify the lib/smushit.js, change the regexp `/.+\\//` -> `/.+[\\/\\\\]/` bugfix: wrong filename writed to the request body under Windows. \r\n\r\n> v0.5.0\r\n* modify the cli.js file to unix format for resolving issue #4\r\n\r\n> v0.4.0\r\n* change path.existsSync to fs.existsSync\r\n\r\n> v0.3.0\r\n* add custom smushit serivce feature\r\n* add global service config for CLI\r\n* can save the smashed file by new name\r\n\r\n> v0.2.0\r\n* add callback while the image(s) smashed completed\r\n\r\n> v0.1.0\r\n* smash by file, filelist, directory\r\n\r\n\r\n\r\n","_attachments":{}}