{
  "name": "transfigure",
  "description": "Transform/transpile higher order file contents to js|css|html",
  "version": "3.4.0",
  "author": "popeindustries <alex@pope-industries.com>",
  "keywords": [
    "compile",
    "compiler",
    "css",
    "buddy",
    "html",
    "js"
  ],
  "dependencies": {
    "chalk": "1.1.0",
    "lodash": "3.10.1",
    "recur-fs": "2.2.1"
  },
  "devDependencies": {
    "expect.js": "*",
    "mocha": "*",
    "rimraf": "*"
  },
  "main": "index.js",
  "scripts": {
    "test": "NODE_ENV=test mocha --reporter spec"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "repository": "git://github.com/popeindustries/transfigure.git",
  "license": "MIT",
  "readmeFilename": "README.md",
  "readme": "[![NPM Version](https://img.shields.io/npm/v/transfigure.svg?style=flat)](https://npmjs.org/package/transfigure)\n[![Build Status](https://img.shields.io/travis/popeindustries/transfigure.svg?style=flat)](https://travis-ci.org/popeindustries/transfigure)\n\n# Transfigure\n\n**Transfigure** is a plug-in based transformer/transpiler for higher order languages that need to be converted to js|css|html. It provides the compile functionality for the [Buddy](https://github.com/popeindustries/buddy) build tool.\n\n## Plug-in transpilers\n\nIn order to add transpilation support to Buddy projects, separate **transfigure-** modules need to be installed alongside Buddy:\n\n```bash\n$ npm install transfigure-coffeescript transfigure-less\n```\n\nThe following plug-ins are currently available (with version numbers tracking their underlying language versions):\n\n**js**\n- [transfigure-babel](https://github.com/popeindustries/transfigure-babel)\n- [transfigure-coffeescript](https://github.com/popeindustries/transfigure-coffeescript)\n- [transfigure-react](https://github.com/popeindustries/transfigure-react)\n\n**css**\n- [transfigure-less](https://github.com/popeindustries/transfigure-less)\n- [transfigure-stylus](https://github.com/popeindustries/transfigure-stylus)\n\n**html**\n- [transfigure-dust](https://github.com/popeindustries/transfigure-dust)\n- [transfigure-handlebars](https://github.com/popeindustries/transfigure-handlebars)\n- [transfigure-jade](https://github.com/popeindustries/transfigure-jade)\n- [transfigure-nunjucks](https://github.com/popeindustries/transfigure-nunjucks)\n- [transfigure-twig](https://github.com/popeindustries/transfigure-twig)\n\n### Writing your own plug-in\n\nWriting a plug-in for *Transfigure* is relatively simple. Each plun-in should conform to the following requirements:\n\n1. Must have a package name starting with *transfigure-*\n2. Must implement the correct `registration` and `compile` behaviour\n3. Must be installed in the current project's *node_modules* directory (or a reachable parent)\n\n#### API\n\nModules must export a `registration` object with `name` and `extensions` properties (Note that a plug-in can register multiple extensions):\n```js\nexports.registration = {\n  name: 'myPlugin',\n  extensions: {\n    js: [\n      'foo',\n      'bar'\n    ]\n  }\n};\n```\n\nModules must export an async `compile` function with the following signature and behaviour:\n```js\nexports.compile = function (content, options, fn) {\n  try {\n    content = myPlugin.api(content, options);\n    fn(null, content);\n  } catch (err) {\n    // Attach current filepath for helpful console output\n    err.filepath = options.filepath;\n    fn(err);\n  }\n};\n```\nThe passed `options` object has the following properties:\n- `filepath`: the fully resolved file path (ex: `/users/alex/projects/foo/src/js/foo.js`)\n- `extension`: the file extension (ex: `js`)\n- `name`: the file name without extension (ex: `foo`)\n- `type`: the build target type (`js`, `css`, or `html`)\n- `includes`: an array of html include/partials objects that can be precompiled/loaded before compilation\n  - `id`: a unique dependency id\n  - `content`: the file content\n- `cache`: an html template cache instance that may be used to store precompiled html templates (see [transfigure-dust](https://github.com/popeindustries/transfigure-dust/blob/master/index.js) and [transfigure-nunjucks](https://github.com/popeindustries/transfigure-nunjucks/blob/master/index.js) for usage)\n"
}
