{"_id":"fusion","_rev":"26-d7a8629b2951df4b746f580131079d46","name":"fusion","description":"JavaScript, HTML, and CSS language framework.","dist-tags":{"latest":"1.0.0-beta"},"versions":{"0.0.1":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.0.1","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"http://deck.cc/","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/deck/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1"},"devDependencies":{"coffee-script":">= 1.0.0","vows":"0.5.3"},"repository":{"type":"git","url":"https://github.com/deck/fusion.git"},"bugs":{"url":"http://github.com/deck/fusion/issues"},"_id":"fusion@0.0.1","_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.3.2","dist":{"tarball":"https://registry.npmjs.org/fusion/-/fusion-0.0.1.tgz","shasum":"7f973c675b15c42f3702d3a286ba6dbad352bd94","integrity":"sha512-ERlxWuUS2l5tePWG3eYfG6LuoOLeP7XEC43DdjNV8bN4HzMt8l2sh+IlMH6yDd9wWgRlLtM2fFOkBU3ktgs7mg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGYbFrtOwmvg3dP5XfmBJuM7/VePK/bfWAL1PLJXSzVqAiEAq0QWO10j06NEk40rKJYz2IKAX1Elde18J/moIsZhqh4="}]}},"0.0.2":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.0.2","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"http://deck.cc/","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/deck/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1"},"devDependencies":{"coffee-script":">= 1.0.0","vows":"0.5.3"},"repository":{"type":"git","url":"https://github.com/deck/fusion.git"},"bugs":{"url":"http://github.com/deck/fusion/issues"},"_id":"fusion@0.0.2","_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.3.2","dist":{"tarball":"https://registry.npmjs.org/fusion/-/fusion-0.0.2.tgz","shasum":"8111487d98e5183bda20271161eb64b6cf7dcb4a","integrity":"sha512-YIwT+AirPUrdlR1LX8H/NqZC6oJ6tpzh16AVdD8+uFgwHi+C/06siUadC12AQwyEnVL9Jv12f76BzhM2ImpM0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJX7GaBsFmcQ/Y09Q5tChh7i6kJblE7CgKItCzXe0jJAIgJf1d7nuSweIWG8roMCehfofSOsE5LuILYVkariyRMiM="}]}},"0.0.3":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.0.3","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"http://deck.cc/","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/deck/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1"},"devDependencies":{"coffee-script":">= 1.0.0","vows":"0.5.3"},"repository":{"type":"git","url":"https://github.com/deck/fusion.git"},"bugs":{"url":"http://github.com/deck/fusion/issues"},"_id":"fusion@0.0.3","_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.3.2","dist":{"tarball":"https://registry.npmjs.org/fusion/-/fusion-0.0.3.tgz","shasum":"310f0e83d8ccfdfdaf86d7f660e2678ae388102c","integrity":"sha512-N1gaCwFmohDN86/Wsn/wr1OCdT9n50dNakiA2BSAb4r3Pqt/4+duPkdTLeQAoamzN6okqAwjtM9gMJkClDQDTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEDI+voRu/Z0AWc8JXsqKQQh7l51tpcHDU0y844xGVgBAiEA4Xm9ybu42nN+1BIHDWypjloDo61IrKhsuD5a7RaZ7bY="}]}},"0.0.4":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.0.4","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"http://deck.cc/","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/deck/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1","underscore":"1.1.4"},"devDependencies":{"coffee-script":">= 1.0.0","vows":"0.5.3"},"repository":{"type":"git","url":"https://github.com/deck/fusion.git"},"bugs":{"url":"http://github.com/deck/fusion/issues"},"_id":"fusion@0.0.4","_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.3.2","dist":{"tarball":"https://registry.npmjs.org/fusion/-/fusion-0.0.4.tgz","shasum":"732b81ccf302d5ae76f92524af8ca11f1ef2633b","integrity":"sha512-4MVHDkBUtnx8Rq9b6veuzx+dJ0qzrSQj+yzY2RJAuyrVYIBm6JQqiLF7YFv13VnfUFx2UpXQZjrUyo8uR7nknQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf+spPcCW/c81guxnQnMaEJdqsxqsu3hmHrmVaDNbnPgIhAK1vvEgvaUCb0RorbqL7jBQdGueRTqhyoB6zImkzKCyM"}]}},"0.0.5":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.0.5","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"http://deck.cc/","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/deck/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1","underscore":"1.1.4"},"devDependencies":{"coffee-script":">= 1.0.0","vows":"0.5.3"},"repository":{"type":"git","url":"https://github.com/deck/fusion.git"},"bugs":{"url":"http://github.com/deck/fusion/issues"},"_id":"fusion@0.0.5","_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.3.2","dist":{"tarball":"https://registry.npmjs.org/fusion/-/fusion-0.0.5.tgz","shasum":"f6cc5655a00fd7d163da8f45f33236af1f8d02c8","integrity":"sha512-uhdMK+dft2EVh8u+WqZvsvihbk5dYEHctEdxjWRhRhGmHna76+pHMvbk3FbfWlj236heJtJW2+H/PvmeyuTRHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHhzjK6yA6hqTKfEPzOw/nj8eC5VH6CTkiZ4RHoCk3nGAiEA9MnrCCwgSO8N1G9QaYyuuU48Q27D2qX3EA4C4VXaaP8="}]}},"0.0.6":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.0.6","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"http://deck.cc/","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/deck/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1","underscore":"1.1.4"},"devDependencies":{"coffee-script":">= 1.0.0","vows":"0.5.3"},"repository":{"type":"git","url":"https://github.com/deck/fusion.git"},"bugs":{"url":"http://github.com/deck/fusion/issues"},"_id":"fusion@0.0.6","_nodeSupported":true,"_npmVersion":"0.2.11-5","_nodeVersion":"v0.4.0","dist":{"shasum":"b643c6436226e074c737e7667952cf1d7b080e22","tarball":"https://registry.npmjs.org/fusion/-/fusion-0.0.6.tgz","integrity":"sha512-yJX1UCUixG6a5alZYFRrY/2icPQj0/mBoe4Gu0jJKQt+QsSmyJi5lOAh6DJY1k8XfvO8SJGTvL0BtlNoPiH3nw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE7mSlWlTZeNaLFO9sAOmBoEsXwRUWPZV45trUbUN6yCAiBEbpfVfJYfvNsQuG0r0TRXRuWXuqwcp/TVRdtyx2HPSQ=="}]}},"0.0.7":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.0.7","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"https://github.com/brunchwithcoffee/fusion","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/brunchwithcoffee/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1","underscore":"1.1.4"},"devDependencies":{"coffee-script":">= 1.0.1","vows":"0.5.6"},"repository":{"type":"git","url":"https://github.com/brunchwithcoffee/fusion.git"},"bugs":{"url":"http://github.com/brunchwithcoffee/fusion/issues"},"_id":"fusion@0.0.7","_nodeSupported":true,"_npmVersion":"0.2.11-5","_nodeVersion":"v0.4.0","dist":{"shasum":"a12c4d2ed92fcced0bc47636cd4e75b5190fb8f1","tarball":"https://registry.npmjs.org/fusion/-/fusion-0.0.7.tgz","integrity":"sha512-EJZ10eMceKNEkCs2FTUQzV4D8McDubWH7JQjkjcvAMegzwUlEdtb2/L58TnFQOGcpEy57Cn+xGZrtdtPRuiNvg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDc7mj/g+e/Th4zwz5TKZk7upctSAB+YKC9uRtdoMEv3AiApPbMcIagUkfjvTkS49vdduqKiE2jikncyQFrEUju1mQ=="}]}},"0.0.8":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.0.8","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"https://github.com/brunch/fusion","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/brunch/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1","underscore":"1.1.4"},"devDependencies":{"coffee-script":">= 1.0.1","vows":"0.5.6"},"repository":{"type":"git","url":"https://github.com/brunch/fusion.git"},"bugs":{"url":"http://github.com/brunch/fusion/issues"},"_id":"fusion@0.0.8","_nodeSupported":true,"_npmVersion":"0.2.11-5","_nodeVersion":"v0.4.0","dist":{"shasum":"331a111cf18277881f50283bdf2acfe5c4161d18","tarball":"https://registry.npmjs.org/fusion/-/fusion-0.0.8.tgz","integrity":"sha512-u8iyodCnLG/wHtfi/DQseX4Q1gr/cyhEpSMe/HwUByMXV6PTXfu6I1B/nk2KmMGq6BDeXq1avM8y9AfPcoSuUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCWEuDMfy7daRvOp7cfzDlX1cc2QV5A2e3Di+3V8qgcwIhAIguR1oeasIpo5xSJOGPVYhFSrRK7lxotONAzvyM4MlN"}]}},"0.1.0":{"name":"fusion","description":"Merge Files into Javascript Namespace","version":"0.1.0","keywords":["jst","templates","namespace","merge","fusion"],"homepage":"https://github.com/brunch/fusion","author":{"name":"Nik Graf @nikgraf"},"licenses":[{"type":"MIT","url":"http://github.com/brunch/fusion/raw/master/LICENSE"}],"engines":["node"],"directories":{"lib":"./lib"},"main":"./lib/fusion","bin":{"fusion":"./bin/fusion"},"dependencies":{"watch":"0.3.0","yaml":"0.1.1","underscore":"1.1.4"},"devDependencies":{"coffee-script":">= 1.0.1","vows":"0.5.6"},"repository":{"type":"git","url":"https://github.com/brunch/fusion.git"},"bugs":{"url":"http://github.com/brunch/fusion/issues"},"_id":"fusion@0.1.0","_nodeSupported":true,"_npmVersion":"0.2.11-5","_nodeVersion":"v0.4.2","dist":{"shasum":"178b06d3f90935cba4589c01bad5b8baf77b0bd2","tarball":"https://registry.npmjs.org/fusion/-/fusion-0.1.0.tgz","integrity":"sha512-DqrZ5TJpWUgR6YxqdmYIz/nTHnyJzY87msSJjC4xvH4y6dD//u2iXM+CU3wrLX90CQa4oCDm2Z3zv9YTeC89Pg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCu9OnJDPBbCc4hav5g+k85oB3HP4jtp9aESVDJUH3nWAIgD+G2+BLTc3+gOBU8YfEJg7rjbsB0q6QO1F/sLtCA0Rg="}]}},"1.0.0-beta":{"name":"fusion","version":"1.0.0-beta","description":"JavaScript, HTML, and CSS language framework.","keywords":["fusion","lexical","syntax","semantic","analysis","highlight","highlighter","language","superset","HTML","CSS"],"homepage":"http://www.fusionlang.org/","bugs":{"url":"http://github.com/gaulinsoft/fusion/issues"},"license":"Apache-2.0","author":{"name":"Nick Gaulin","email":"contact@gaulinsoft.com"},"main":"fusion","repository":{"type":"git","url":"http://github.com/gaulinsoft/fusion.git"},"_id":"fusion@1.0.0-beta","dist":{"shasum":"6d653f56688224dd0519bd54abb398f9afadf2a8","tarball":"https://registry.npmjs.org/fusion/-/fusion-1.0.0-beta.tgz","integrity":"sha512-J0ONizZFbTdENJzZsAGwVi/rKVTPQxfgTVgt5BZhhfrPrlQEMQz+cbpX+8awZsgpI1QaZen2Syy7N/XuKj8mPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF48Ommz2a/BDTNG5qaJCqzecvv3JPbup1G9CJVFZLQYAiA+Xt2an83Y+lBjvM0YYuT2UMlkMCRmaII6akwrUz1ugw=="}]},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"redline","email":"contact@gaulinsoft.com"},"maintainers":[{"name":"redline","email":"contact@gaulinsoft.com"}]}},"maintainers":[{"name":"redline","email":"contact@gaulinsoft.com"}],"time":{"modified":"2022-06-18T04:25:33.687Z","created":"2011-01-18T13:40:34.068Z","0.0.1":"2011-01-18T13:40:34.505Z","0.0.2":"2011-01-20T01:02:05.832Z","0.0.3":"2011-01-20T02:29:06.827Z","0.0.4":"2011-01-31T06:05:13.001Z","0.0.5":"2011-01-31T12:54:20.877Z","0.0.6":"2011-02-16T01:15:23.348Z","0.0.7":"2011-02-16T17:39:54.834Z","0.0.8":"2011-02-17T11:25:11.649Z","0.1.0":"2011-03-15T09:11:24.051Z","1.0.0-beta":"2014-07-08T13:12:40.643Z"},"author":{"name":"Nick Gaulin","email":"contact@gaulinsoft.com"},"repository":{"type":"git","url":"http://github.com/gaulinsoft/fusion.git"},"homepage":"http://www.fusionlang.org/","keywords":["fusion","lexical","syntax","semantic","analysis","highlight","highlighter","language","superset","HTML","CSS"],"bugs":{"url":"http://github.com/gaulinsoft/fusion/issues"},"readme":"# [fusion](http://www.fusionlang.org/): A language framework and superset for JavaScript, HTML, and CSS\r\n\r\n##### Framework\r\nFusion provides a simple and straightforward collection of functions to analyize JavaScript, HTML, and CSS.\r\nA syntax highlighter along with other lexer-parser utilities for these languages are available in this framework.\r\nThe lexical analysis phase also provides an optional lightweight parser hack to allow for fast and efficient conversions while still offering language transitions and advanced detection of regexp and object literals.\r\n\r\n##### Language\r\nFusion utilizes various language components of JavaScript, HTML, and CSS to provide more robust and maintainable code.\r\nThis superset aims for a very natural development platform that seamlessly transitions between each language.\r\nIt not only makes source code easier to understand and maintain, but can also remove the need for JavaScript libraries such as jQuery to construct DOM elements using document fragments and innerHTML.\r\nSince it's designed to work natively with the DOM, Fusion can increase performance by assisting front-end libraries or sometimes eliminating the need for them altogether.\r\nOtherwise, an optional lightweight DOM library (3KB, gzipped) is also provided to further simplify your code and make working with the DOM a little more intuitive by extending `Element` and `Array` objects.\r\n\r\n> Fusion does not have any releases and is still a work in progress. Please feel free to create an issue if you'd like to propose any other language features.\r\n\r\n## Contents\r\n- [Features](#features)\r\n\t- [Syntax Highlighting](#syntax-highlighting)\r\n\t- [Lexical Analysis](#lexical-analysis)\r\n\t\t- [Arguments](#arguments)\r\n\t- [Converting Fusion to JavaScript](#converting-fusion-to-javascript)\r\n- [Language Features](#language-features)\r\n\t- [Inline HTML](#inline-html)\r\n\t- [Template Strings](#template-strings)\r\n\t- [Attribute Template Strings](#template-strings-in-html-attributes)\r\n\t- [Inline CSS Styles](#inline-css-styles)\r\n\t- [Inline CSS Selectors](#inline-css-selectors)\r\n\t- [HTML Substitutions](#template-substitutions-in-html)\r\n\t- [CSS Style Substitutions](#template-substitutions-in-css-styles)\r\n\t- [CSS Selector Substitutions](#template-substitutions-in-css-selectors)\r\n- [Setup](#setup)\r\n\t- [Node.js](#nodejs)\r\n\t- [Optional DOM Library](#dom-library-optional)\r\n\r\n## Features\r\n\r\n#### Syntax highlighting\r\n```text\r\nfusion.highlight(source [, language [, strict]])\r\n```\r\n\r\n_Returns:_ string of HTML\r\n\r\n#### Lexical analysis\r\n\r\n```text\r\nfusion.tokenize(source [, language [, strict]])\r\n```\r\n\r\n_Returns:_ array of `{ type, start, end }` objects\r\n\r\n#### Syntax + Semantic analysis\r\n\r\n> Eventually...\r\n\r\n##### Arguments\r\n\r\n* _source_\r\n\t* string of source code\r\n* _language_\r\n\t* string of source code language\r\n\t* supports `js`, `html`, `css`, and `fjs`\r\n\t* defaults to `fjs`\r\n* _strict_\r\n\t* boolean for strict mode, which forces the `js`, `html`, and `css` languages to be context-free\r\n\t* removes `<script>` and `<style>` language transitions in `html`\r\n\t* removes template strings and advanced regexp and object literal detection in `js`\r\n\t* defaults to `false`\r\n\r\n#### Converting Fusion to JavaScript\r\n```text\r\nfusion.transpile(source [, create [, find [, query [, attr [, html]]]]])\r\n```\r\n\r\n_Returns:_ string of JavaScript\r\n\r\n##### Arguments\r\n\r\n* _source_\r\n\t* string of fusion source code\r\n* _create_\r\n\t* string for a function similar to `createElement()`\r\n\t* defaults to `document.__create`\r\n* _find_\r\n\t* string for a function similar to `querySelector()`\r\n\t* defaults to `document.__find`\r\n* _query_\r\n\t* string for a function similar to `querySelectorAll()`\r\n\t* defaults to `document.__query`\r\n* _attr_\r\n\t* string for a function similar to `setAttribute()`\r\n\t* defaults to `__attr`\r\n\t* must return a reference to `this`\r\n* _html_\r\n\t* string for a function similar to `innerHTML` property\r\n\t* defaults to `__html`\r\n\t* must return a reference to `this`\r\n\r\n### Language Features\r\n\r\n#### Inline HTML\r\n![Inline HTML](http://cdn.gaulinsoft.com/fusion/readme_html.png)\r\n\r\n#### Template strings\r\n![Template String](http://cdn.gaulinsoft.com/fusion/readme_templatestring.png)\r\n\r\n#### Template strings in HTML attributes\r\n![Template String in HTML Attribute](http://cdn.gaulinsoft.com/fusion/readme_html_templatestring.png)\r\n\r\n#### Inline CSS styles\r\n![Inline CSS Style](http://cdn.gaulinsoft.com/fusion/readme_css_object.png)\r\n\r\n#### Inline CSS selectors\r\n![Inline CSS Selectors](http://cdn.gaulinsoft.com/fusion/readme_css_selectors.png)\r\n\r\n#### Template substitutions in HTML\r\n![Inline HTML Substitution](http://cdn.gaulinsoft.com/fusion/readme_html_substitution.png)\r\n\r\n#### Template substitutions in CSS styles\r\n![Inline CSS Style Substitution](http://cdn.gaulinsoft.com/fusion/readme_css_object_substitution.png)\r\n\r\n#### Template substitutions in CSS selectors\r\n![Inline CSS Selector Substitution](http://cdn.gaulinsoft.com/fusion/readme_css_selector_substitution.png)\r\n\r\n## Setup\r\n\r\nIf you'd like to natively use the DOM, the following `__attr()` and `__html()` functions must be assigned to `Element.prototype` for inline HTML and CSS:\r\n```javascript\r\nElement.prototype.__attr = function(n,v){this.setAttribute(n,v);return this};\r\nElement.prototype.__html = function(c){this.innerHTML=c;return this};\r\n```\r\n\r\nThe `transpile()` function can then be called with the first three optional arguments as follows:\r\n```javascript\r\nfusion.transpile(source, \"document.createElement\", \"document.querySelector\", \"document.querySelectorAll\")\r\n```\r\n\r\nOr they can be omitted if assigned to `Document.prototype`:\r\n```javascript\r\nDocument.prototype.__create = Document.prototype.createElement;\r\nDocument.prototype.__find   = Document.prototype.querySelector;\r\nDocument.prototype.__query  = Document.prototype.querySelectorAll;\r\n```\r\n\r\nOtherwise, an optional lightweight DOM plugin (3KB, gzipped) can be included using `fusion-dom.js`.\r\n\r\n### Node.js\r\n\r\nThe following example configures Node.js to transpile files in the `/fjs` directory and cache them in memory when requested through the `/static` URL:\r\n\r\n```javascript\r\nvar http    = require('http'),\r\n    through = require('through'),\r\n    st      = require('st'),\r\n    fusion  = require('fusion');\r\n\r\nvar mount  = st({ url:  '/static', path: __dirname + '/fjs' }),\r\n    filter = through(function(data) { this.emit('data', fusion.transpile(data.toString())) });\r\n\r\nhttp.createServer(function(req, res)\r\n{\r\n    res.filter = filter;\r\n\r\n    if (mount(req, res))\r\n        res.setHeader('content-type', 'application/javascript');\r\n})\r\n.listen(1337);\r\n\r\nconsole.log('Server running on port 1337...');\r\n```\r\n\r\nThis concept can also be applied with the `fusion.highlight()` function (and either a `text/plain` or `text/html` content-type) to serve up highlighted HTML of the source code.\r\n\r\n> Settings for the `st()` function can be found here: https://github.com/isaacs/st\r\n\r\n### DOM Library (optional)\r\n\r\nThe `fusion-dom.js` file can be included to extend the `Element`, `Array`, and `Document` prototypes.\r\nThis file does NOT require `fusion.js`, and the prototype assignments above are also not required when including this library since it already defines `__attr()` and `__html()` functions on the `Element` prototype and `__create()`, `__find()`, and `__query()` functions on the `Document` prototype.\r\n\r\nThese prototype functions can be accessed natively or using the `@` operator:\r\n```text\r\n@(div.container).__attr('title', null);\r\n@(div.container)@attr('title', null);\r\n```\r\n\r\nThis DOM library allows a seamless transition between arrays and elements.\r\nThe `__find()` function returns either an element or `null`, and the `__query()` function returns either an array of elements or an empty array.\r\n\r\nElement\r\n* after()\r\n* append()\r\n* attr()\r\n* before()\r\n* child()\r\n* children()\r\n* contains()\r\n* find()\r\n* first()\r\n* html()\r\n* last()\r\n* matches()\r\n* next()\r\n* parent()\r\n* prepend()\r\n* prev()\r\n* query()\r\n* remove()\r\n* replace()\r\n* style()\r\n* text()\r\n* document\r\n* length\r\n* tag\r\n\r\nArray\r\n* attrs()\r\n* children()\r\n* filter()\r\n* find()\r\n* first()\r\n* html()\r\n* last()\r\n* matches()\r\n* next()\r\n* not()\r\n* parent()\r\n* prev()\r\n* query()\r\n* remove()\r\n* styles()\r\n* text()\r\n\r\nDocument\r\n* contains()\r\n* create()\r\n* find()\r\n* query()\r\n\r\n```text\r\n[\r\n\t<div />,\r\n\t<div />,\r\n\t<pre />\r\n]\r\n@attrs(\"data-ready\", Date.now())\r\n@prependTo(element)\r\n@style(@{\r\n\t-webkit-animation: slide ${duration / 1000}s ease-in-out;\r\n});\r\n\r\ndocument\r\n\t@query(\"span\")\r\n\t@attrs(\"style\", null)\r\n\t@first()\r\n\t\t@attr(\"data-ready\", Date.now())\r\n\t\t@after(<span class=\"second\" />);\r\n```\r\n","readmeFilename":"README.md","license":"Apache-2.0"}