{"name":"directory-encoder","description":"Encode a directory of images to CSS","version":"0.9.0","homepage":"https://github.com/filamentgroup/directory-encoder","author":{"name":"John Bender/Jeffrey Lembeck/Filament Group","email":"thegroup@filamentgroup.com"},"repository":{"type":"git","url":"git+https://github.com/filamentgroup/directory-encoder.git"},"bugs":{"url":"https://github.com/filamentgroup/directory-encoder/issues"},"license":"MIT","main":"lib/directory-encoder","engines":{"node":">= 0.10.0"},"scripts":{"test":"grunt travis --verbose"},"dependencies":{"fs-extra":"^0.23.1","handlebars":"^4.0.0","img-stats":"^0.5.2"},"devDependencies":{"grunt":"^0.4.5","grunt-cli":"^0.1.13","grunt-contrib-jshint":"^0.11.1","grunt-contrib-nodeunit":"^0.4.1","grunt-contrib-watch":"^0.6.1","lodash":"^2.4.0"},"keywords":[],"gitHead":"e85f5b35ff7470172773558b8307dab8ea262f1a","_id":"directory-encoder@0.9.0","_shasum":"268bac53b25181059710e1f8bfe69eaa890ea31a","_from":".","_npmVersion":"4.0.3","_nodeVersion":"4.4.6","_npmUser":{"name":"jlembeck","email":"jlembeck@gmail.com"},"dist":{"shasum":"268bac53b25181059710e1f8bfe69eaa890ea31a","tarball":"http://registry-npm.ywwl.com/directory-encoder/download/directory-encoder-0.9.0.tgz","integrity":"sha512-p8hJsKk3xApjtSeD37k5jNCqOIwZje3g0l22UDErAq4OKMHJ7/XmtF1wT/iNsH10yNwss8AaeF87qoocwu/nbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqLKMgpqNinQEnVcdEz2qlucaJhp1dw/kBhz0dIG+34AiEAuPsIelxdEyxj7boX3/rYEDTz4RjxQIVjrZb8/Qm8uLo="}],"size":11787,"noattachment":false,"key":"/directory-encoder/-/directory-encoder-0.9.0.tgz"},"maintainers":[{"name":"filamentgroup","email":"thegroup@filamentgroup.com"},{"name":"jefflembeck","email":"jlembeck@gmail.com"},{"name":"jlembeck","email":"jlembeck@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/directory-encoder-0.9.0.tgz_1480806960657_0.6312876723241061"},"directories":{},"readme":"# directory-encoder [![Build Status](https://secure.travis-ci.org/filamentgroup/directory-encoder.png?branch=master)](http://travis-ci.org/filamentgroup/directory-encoder)\n\n[![Filament Group](http://filamentgroup.com/images/fg-logo-positive-sm-crop.png) ](http://www.filamentgroup.com/)\n\nEncode a directory of PNG or SVG images to CSS\n\n## Getting Started\nInstall the module with: `npm install directory-encoder`\n\n```javascript\nvar DirectoryEncoder = require('directory-encoder');\nvar de = new DirectoryEncoder( source, destinationCSSFile, {\n\t\t\tpngfolder: pngfolder, //in case you need to link out for PNGs, like when the datauri is way too long\n\t\t\tcustomselectors: { \"foo\": [\".bar\", \".baz\"]}, \n\t\t\tprefix: \".icon-\", // used to prefix the name of the file for the CSS classname, .icon- is the default\n\t\t\ttemplatePrepend: \"/* start of icon-list */\", // this string is prepended to the destinationCSSFile, defaults to \"\"\n\t\t\thandlebarsCallback: function(hbs) { /* configure handlebars, with custom helpers for example */ }, // callback to configure handlebars\n\t\t\ttemplate: template.hbs, //template in handlebars, FANCY!\n\t\t\ttemplateAppend: \"/* end of icon-list */\", // this string is appended to the destinationCSSFile, defaults to \"\"\n\t\t\tnoencodepng: false // turn this to true if you want no datauris for pngs, just links out to png files\n\t\t});\nde.encode(); // \"Guitar solo -- File outputted\"\n```\n\n## Documentation\n\n### Constructor\n\nTakes three arguments, source directory for encoding/an array of files\nyou'd like to encode, destination css\nfile for when it writes, and an options hash that includes a spot for\ncustomselectors, a hbs template in case you want to get nuts with your\ncss, where the pngs are located if you want to link out to them (or you\ndon't have a choice because the data uri is bigger than 32k), and a\nswitch to turn off datauris for pngs.\n\n### encode\n\nAll the magic happens here.\n\n## Examples\n```\nvar de = new DirectoryEncoder( source, destinationCSSFile, {\n\t\t\tpngfolder: pngfolder, //in case you need to link out for PNGs, like when the datauri is way too long\n\t\t\tcustomselectors: { \"foo\": [\".bar\", \".baz\"]}, \n\t\t\ttemplate: template.hbs, //template in handlebars, FANCY!\n\t\t\tnoencodepng: false // turn this to true if you want no datauris for pngs, just links out to png files\n\t\t});\nde.encode(); // \"Guitar solo -- File outputted\"\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n\n* 0.7.0  Add templateAppend and templatePrepend options\n* 0.6.0  Fix encoding brackets and ability to take an array\n* 0.5.0  PNGpath\n* 0.4.0  Width/Height from template\n* 0.3.0  Adding custom selectors that allow for wildcards\n* 0.2.0  Adding switchable icon name prefixes\n* 0.1.0  Woo\n\n## License\nCopyright (c) 2013 John Bender/Jeffrey Lembeck/Filament Group\nLicensed under the MIT license.\n","publish_time":1480806962512,"_cnpm_publish_time":1480806962512,"dist-tags":{"latest":"0.9.2"}}