{"name":"directory-encoder","description":"Encode a directory of images to CSS","version":"0.3.2","homepage":"https://github.com/filamentgroup/directory-encoder","author":{"name":"John Bender/Jeffrey Lembeck/Filament Group","email":"thegroup@filamentgroup.com"},"repository":{"type":"git","url":"https://github.com/filamentgroup/directory-encoder"},"bugs":{"url":"https://github.com/filamentgroup/directory-encoder/issues"},"licenses":[{"type":"MIT","url":"https://github.com/filamentgroup/directory-encoder/blob/master/LICENSE-MIT"}],"main":"lib/directory-encoder","engines":{"node":">= 0.10.0"},"scripts":{"test":"grunt travis --verbose"},"dependencies":{"fs-extra":"0.8.1","handlebars":"1.1.2","lodash":"2.4.0"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-nodeunit":"~0.1.2","grunt-contrib-watch":"~0.2.0","grunt":"~0.4.2"},"keywords":[],"_id":"directory-encoder@0.3.2","dist":{"shasum":"8c3f8c85a5a7052c06d85aca7ce4218c1a682d52","tarball":"http://registry-npm.ywwl.com/directory-encoder/download/directory-encoder-0.3.2.tgz","integrity":"sha512-2hm0swTg/2unbwu+XlLMfIuz/wXupKN2GMCnakmDnzHspBjBukgGmlB9idmFlcx7am7RXW/0JELG/8Bw1b7xew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEpmkSw30C5TEBTpAOjgqiXjixopFEu540khERDKnhg8AiEA+1u2Lq4YjObJ9J8xALYRDGxYQ53jF1IMz+EJr3FncH8="}],"size":7552,"noattachment":false,"key":"/directory-encoder/-/directory-encoder-0.3.2.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"filamentgroup","email":"thegroup@filamentgroup.com"},"maintainers":[{"name":"filamentgroup","email":"thegroup@filamentgroup.com"}],"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":1386945961243,"_cnpm_publish_time":1386945961243,"dist-tags":{"latest":"0.9.2"}}