{"_id":"hascan","_rev":"9-e01f3a69a09e62403ea2d895bdcb1f80","name":"hascan","description":"Build tools for has.js.","dist-tags":{"latest":"0.0.10"},"versions":{"0.0.1":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.1","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"_id":"hascan@0.0.1","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"6afe912933661959bbdd8a0fd4c5c3444f53a6f8","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.1.tgz","integrity":"sha512-9rc3Nh4pF87hc/L4EaX+lxZbHHG9VtqBZONlJvVE9RGjMqR6XsMTL8HasuyZ2zVJdZOhpkHJOdKscKMdTeB0nA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYWZSDoRJD5djz6GkWYU+8m426hcB1NJnVNhSD/g6F4gIgJZaxB04fb2P8JoZOQmdlMs73zmCHG2X5iwg88YK+VRY="}]},"scripts":{}},"0.0.2":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.2","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"_id":"hascan@0.0.2","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"a12c79b454277767934a1403298853fc9bf96dc1","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.2.tgz","integrity":"sha512-SoSReLeEMftJUkktTU3bwI4UDf6pJakfLUxbWFUnK8RN5G8+YC2GppBIScX7ombnPoLQP4lbrSGYpbmz+4YIWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgvsrhjaOh7uIaPj4DIu5PN34mnRHJdjPL9tj0rgn0xwIhAPlfzrOZZTqYpjhKxNLU6xR1l3pPWwG70R4h8FFshjPs"}]},"scripts":{}},"0.0.3":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.3","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"_id":"hascan@0.0.3","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"6325ccefd3b8004acc445543460186431a627a7d","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.3.tgz","integrity":"sha512-7dDREqxge02g45svmSsm6ofIIN7GBKJu8lheJuqR2glqWpkajLpnSkKVzU+CJGW6iPNW1Tl90gQBGMCrVJYswg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICEsgOruJq9DobQpQJvJ3OKACWDDoCifCM+gqfG8YUPiAiEAtMRH7wPNUij91m6r/iKLgmHUagTLKSACLSvEicDuCug="}]},"scripts":{},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}]},"0.0.4":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.4","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"_id":"hascan@0.0.4","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"85cef03ec3679f4431ce3c1f0c44f577a3a92f5d","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.4.tgz","integrity":"sha512-21rwWVxlA88eiMeapp3WH7MdTlnAHqSYW7LbRu3NBV0AvzcUkcwvnVnSJ3S04/kzUaPP7gxUGDudpZ0Mn2xtAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEfTHJx0xIs/ID8pcG+R45xNUfK1AZI3jt07Pe6NS3VDAiEAv+7F/9w9v7/wSu797izLKxeOFF49vGr3aBQ8LgiOg9M="}]},"scripts":{},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}]},"0.0.5":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.5","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"_id":"hascan@0.0.5","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"d950325c415b3e7e4c1660cbdd1a24599a07e2c8","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.5.tgz","integrity":"sha512-gTDECA4gxW41X7+OsNvRTzQ6Qwkc4mJKr2RiyHTndkt+QImypUwl36vnDbHlbZbzr9kasReTt/etDFHw9dIB0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbwUkQWYwgNMJM1vxcoqS1H++OtY1i5UDwrQ9VKiIhYQIgPaTBk1/T1vCtkD4Bgcfj9b7sP/uYRGjS4LCan+pc8KQ="}]},"scripts":{},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}]},"0.0.6":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.6","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"_id":"hascan@0.0.6","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"efad93debee797466840d43497ddac31c8779d36","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.6.tgz","integrity":"sha512-zWTh3psFD1ZqsDZx0Tzx8Ia63dYfsvK8KEN2rdYG9z/FTN7F4P4AClOYluELivCB4fRnR9bP1lGJgSKHMEF7Dw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAIieDe3+2yU9UQdKDUogezNYHL1le1DXGXIEuPGorILAiEAjxzIhIgtgix7T3SFsllREbp+DGO1ta5NRYwEC4QRdDc="}]},"scripts":{},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}]},"0.0.7":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.7","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"optionalDependencies":{},"_npmUser":{"name":"joehewitt","email":"joe@joehewitt.com"},"_id":"hascan@0.0.7","_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"c00ea1a89b4b12ddc4a7c4ca52c725b68776bcc9","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.7.tgz","integrity":"sha512-tDSlnsjPOharUCNP9QWM81mpWpLzK8PWZN4GRqkpaZVXNL0vheZD4lUhtC3j9V4GayMAQg+6brJa5xeeGRqglg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGWv8s3NgCM+rPmAxz2X9Iae9I48SmlwntZLERDeqoDgIgYjnjjBUUA8NLk8jFo5IlSV3FaIFHaDLuYH9z7ohGhDs="}]},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}]},"0.0.8":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.8","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"optionalDependencies":{},"_npmUser":{"name":"joehewitt","email":"joe@joehewitt.com"},"_id":"hascan@0.0.8","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"4129add11ce89539749a468d309e9ff8cb37ea9a","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.8.tgz","integrity":"sha512-Stl57WNsXD2YXFcYfiK0nrhf56eqpxCZkBRvlpKnE8wywNKGxCwDIF/Q6U7VGk1pF5h5FIA7LyjqS2o65J/SJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjKYYq8VbJIsRZlapNkI7rjhnP3yF53Kj1g/xsKRGE7AiBjJ/BzEssrj6/j0JfJbuUZ7XU6nPONre1Q9SmiHvuhVg=="}]},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}]},"0.0.9":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.9","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"optionalDependencies":{},"bugs":{"url":"https://github.com/joehewitt/hascan/issues"},"_id":"hascan@0.0.9","_shasum":"f4e61191276c9f2d840157950f0c76b257db7004","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"joehewitt","email":"joe@joehewitt.com"},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}],"dist":{"shasum":"f4e61191276c9f2d840157950f0c76b257db7004","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.9.tgz","integrity":"sha512-zpea1PMgIwuXXHCSrXBsDDxIBTcunRhGFeoasOH+djyaBtQFrdET5Ik/FYWQuSYVrczSFH5Y0c3H4Ak1j7nnUw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGi17wfJP6MTZ9H+ynYFfwvyr+mlUHdPRC0r2jL9G+70AiEAxwECkQ0p0zS+U9/v2mygdf+2XVv4H/VDzX0sOoTGNBI="}]}},"0.0.10":{"name":"hascan","description":"Build tools for has.js.","version":"0.0.10","homepage":"http://github.com/joehewitt/hascan","repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"keywords":[],"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"contributors":[],"dependencies":{"async":"","dandy":"","transformjs":"","ua-parser":"","underscore":""},"engines":{"node":">=0.4.0"},"main":"./lib/hascan","bin":{"hascan":"./bin/hascan"},"directories":{},"devDependencies":{},"optionalDependencies":{},"bugs":{"url":"https://github.com/joehewitt/hascan/issues"},"_id":"hascan@0.0.10","_shasum":"1e3be93cfb4136579f0a71b3c293337591122d0b","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"joehewitt","email":"joe@joehewitt.com"},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}],"dist":{"shasum":"1e3be93cfb4136579f0a71b3c293337591122d0b","tarball":"https://registry.npmjs.org/hascan/-/hascan-0.0.10.tgz","integrity":"sha512-CPFx/TopeZDTbcuhwMv9q6R7Arw83Xu2kYkIVMpbVIU9RRFGlT7bfnl5dz6imuMxDb2E6y/oIy2+I4PYOjDGCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFYFn9lUyCp1uZwEoXVfMWexRF/q8FtVRG+m1C9DJi8/AiEA4mwl4sWhMwvIndEspsLCh/bySyv18yCG4av5dqqmnnw="}]}}},"maintainers":[{"name":"joehewitt","email":"joe@joehewitt.com"}],"time":{"modified":"2022-06-18T19:26:54.172Z","created":"2011-07-25T22:48:32.576Z","0.0.1":"2011-07-25T22:48:33.179Z","0.0.2":"2011-07-31T01:31:12.115Z","0.0.3":"2011-08-13T21:55:40.718Z","0.0.4":"2011-09-04T07:42:31.309Z","0.0.5":"2011-09-04T08:51:08.935Z","0.0.6":"2011-09-14T05:13:15.088Z","0.0.7":"2012-04-14T21:12:23.890Z","0.0.8":"2012-04-17T01:15:05.680Z","0.0.9":"2014-05-12T23:39:04.674Z","0.0.10":"2014-05-13T18:14:18.431Z"},"author":{"name":"Joe Hewitt","email":"joe@joehewitt.com"},"repository":{"type":"git","url":"git://github.com/joehewitt/hascan.git"},"readme":"hascan\n===========\n\nBuild slim versions of has.js or use has.js on the server to optimize your code.\n\nSlimming has.js\n---------------\n\n[has.js][] adds a non-trival amount of code to your pages.  With hascan, you can build a version of has.js that includes only the feature tests you actually use in your code.\n\n    hascan --build svg canvas audio-mp3\n\nThis will output a concatenation of the core of has.js and only the individual tests you call for.\n\n    hascan --build < /path/to/file.js\n\nThis will read the given file to find out which has('feature') tests are used and output a build of has.js for only those features.\n\nSlimming Your Code\n------------------\n\nGive Hascan a user-agent string and it will build a version of your code which eliminates has('feature') branches intended for other browsers.  Using data from [Browserscope][], Hascan can determine which features a browser supports, statically analyze your code using [Uglify][], and safely remove branches not intended for that browser.\n\n    hascan --eliminate -a \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.803.0 Safari/535.1\" < /path/to/file.js\n\nInstallation\n------------\n\n    $ npm install hascan\n\nUsage (command line)\n-------------------\n\n    Usage: hascan [options] [features]\n\n    Options:\n        -b, --build              builds has.js with only the tests you want\n                                    Use [features] arguments to specify feature tests to include\n                                    Use --file or stdin to include only features tested in JS source\n        -e, --eliminate          eliminates has() branches for unavailable features\n                                    Use [features] arguments to specify available features\n                                    Use --agent to look up the features available for a user-agent\n                                    Use --file option or stdin to provide JavaScript to process\n        -s, --features           shows a list of features supported by a user agent\n                                    Use --agent to specify the user-agent to query\n                                    Use [features] arguments to limit list to a set of features\n        -t, --tests              shows the names of all tests supported\n        -u, --update             downloads the latest data from Browserscope to has.json\n\n        -a, --agent              user agent string\n        -f, --file               path of a file to read in\n        -m, --minify             minify generated source code\n\n        -h, --help               output help information     \n\nUsage (from Node.js)\n-------------------\n\nEliminating code:\n\n    var hascan = require('hascan');    \n    var sourceCode = 'if (has(\"svg\")) { a() } else if (has(\"canvas\")) { b() } else { c() }';\n    var featureMap = {svg: false, canvas: true};\n    var smallerCode = hascan.eliminateFeatureTests(sourceCode, featureMap);\n    console.log(smallerCode);\n\n...\n    \n    {b()}\n\n        \nGetting features supported by a user-agent: \n\n    var hascan = require('hascan');\n    var userAgent = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.803.0 Safari/535.1\";\n    hascan.getFeatureDB(['canvas', 'svg', 'activex'], function(err, featureDB) {\n        var featureMap = featureDB.getFeatureMap(userAgent);\n        console.log(featureMap);\n    });\n\n...\n\n    { canvas: true, svg: true, activex: false }\n\nBrowserscope\n------------\n\nHascan uses data posted to Browserscope here:\n\n[http://www.browserscope.org/user/tests/table/agt1YS1wcm9maWxlcnINCxIEVGVzdBiG3-0GDA?v=3](http://www.browserscope.org/user/tests/table/agt1YS1wcm9maWxlcnINCxIEVGVzdBiG3-0GDA?v=3)\n\nThis data may not yet cover all browsers. If there is a browser missing, [go here](http://joehewitt.com/has/tests/runTests.html) and post test results for that browser.\n\nLicense \n-------\n\nCopyright 2011 Joe Hewitt\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n \n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n[has.js]: https://github.com/phiggins42/has.js\n[Browserscope]: http://www.browserscope.org/user/tests/table/agt1YS1wcm9maWxlcnINCxIEVGVzdBiG3-0GDA?v=3\n[Uglify]: https://github.com/mishoo/UglifyJS\n","readmeFilename":"README.md","homepage":"http://github.com/joehewitt/hascan","keywords":[],"contributors":[],"bugs":{"url":"https://github.com/joehewitt/hascan/issues"}}