{"_id":"htmx","_rev":"4-7c3ccbebdc1d10189f70c4a7f5f81878","name":"htmx","description":"Use Javascript in place of PHP","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"htmx","version":"0.0.1","description":"Use Javascript in place of PHP","homepage":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe","scripts":{"build":"build.sh"},"repository":{"type":"git","url":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe.git"},"author":{"name":"Yuli Che.","email":"god.DLL@iCloud.com"},"license":"MIT","dependencies":{},"keywords":["php","web"],"main":"htmx.js","bin":{"htmx":"htmx.js"},"files":["TODO.md"],"gitHead":"48c895ca80bb4b744e0336b6d71dfd27b4ca9106","bugs":{"url":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe"},"_id":"htmx@0.0.1","_shasum":"408237ebc3cd1807dee18a688f28b9e98e5c6f98","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"god.dll","email":"god.dll@icloud.com"},"maintainers":[{"name":"god.dll","email":"god.dll@icloud.com"}],"dist":{"shasum":"408237ebc3cd1807dee18a688f28b9e98e5c6f98","tarball":"https://registry.npmjs.org/htmx/-/htmx-0.0.1.tgz","integrity":"sha512-m9FYnm4lEjMC0Hib84F6fwScYqMranFYhYE/5AsOEunOOdLBnWjFdgf0InrYiaeqOyQ8JKvDj6le4VvbRUjB+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkRs9aH+lb6hpsgxKdZxiZkGVNbxO09FmWyaOEvQbrdAiA2+98L6CIlniboo6+XK72pjbM5ixL3BhHM1txr7Hca0Q=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/htmx-0.0.1.tgz_1466523053338_0.1930576569866389"}},"0.0.2":{"name":"htmx","version":"0.0.2","description":"Use Javascript in place of PHP","homepage":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe","scripts":{"build":"build.sh"},"repository":{"type":"git","url":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe.git"},"author":{"name":"Yuli Che.","email":"god.DLL@iCloud.com"},"license":"MIT","dependencies":{},"keywords":["php","web"],"main":"htmx.js","bin":{"htmx":"htmx.js"},"files":["TODO.md","htmx.js","cli.js","preprocess.js","watch.js"],"gitHead":"2154551fb333e861ab258ccb42e6d30fd2733a04","bugs":{"url":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe"},"_id":"htmx@0.0.2","_shasum":"790b3cd816b74f9f2648326e5f4f8a9b320f9fb0","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"god.dll","email":"god.dll@icloud.com"},"maintainers":[{"name":"god.dll","email":"god.DLL@iCloud.com"}],"dist":{"shasum":"790b3cd816b74f9f2648326e5f4f8a9b320f9fb0","tarball":"https://registry.npmjs.org/htmx/-/htmx-0.0.2.tgz","integrity":"sha512-FfUo3ynRYr6Ra4vqmS4Nq9g47607FSmvHYCOuU8bvbW8s4kPMhAmCbMBjuW2cEZI6DauaFNZKinfgV91cc9Feg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFeW3bm/tPT0aM4ifzrfWaEMzO5sMrcoqxFurJlfB4KDAiBNE16qVVweWzdO28xdWkeJiCmBtCvRpC1jZdTh6w68/w=="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/htmx-0.0.2.tgz_1466525023174_0.9458115361630917"}}},"readme":"HTMX - static document generator, with Javascript preprocessing\n====\n\nUse Javascript where you would ordinarily use PHP or some templating language.\n\n### STATUS: [v0.0.2](https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe/2154551fb333e861ab258ccb42e6d30fd2733a04) _so **alpha** it hurts_\nThis has just been hacked together, so expect a bumpy ride.\n\n\nOverview\n---\n\n    $ echo \"1::b::3\" | htmx --context \"{b:'2'}\"\n    → 123\n\nDefault script delimiters are the same for left and right side. Double\ncolon `::` was chosen for it's scarse use in websites source-code.\n\nYou can set it up with `['<\\\\?', '\\\\?>']` delimiters for PHP-like short tags.\n\nIf your Javascript returns an object structure instead of a text response, (say\nsome vDOM) you can use the `preprocess()` function to layout the final output.\n\n\nDownload\n---\n\n    npm install -g htmx\n\nNode.js Quickstart\n-------\n\n    var\n    fs= require('fs'),\n    htmx= require('htmx')()\n\n    fs.writeFileSync(\n      'test.html',                                // → \"123\"\n      htmx(\n        fs.readFileSync('test.htmx').toString(),  // → \"1::b::3\"\n        fs.readFileSync('test.js').toString()     // → \"{b:2}\"\n    ))\n\n\nShell Quickstart\n-----\n\n    $ cat index.html\n    → \"1::b::3\"\n    $ cat index.js\n    → {b:'2'}\n    $ htmx --context index.js  --template index.html\n    → 123\n    // -c can be a JSON string\n    // if -t is missing, STDIN is used instead\n    $ htmx --root .  --build ../build  // see TODO.md\n    // builds current dir, using index.js for context, if exists\n\nF. A. Q. (advanced usage)\n-------\n\nAll shell options can be shortened, as long as they are distinguishable.  \nSo the `--root` option can become `-r` and the `--context` option can become `-c`\n\nUse the `--delimiter` option like so: `htmx -d \\\\\\{\\\\\\{ \\\\\\}\\\\\\}`. Yes, I know.  \nRegExp escape, shell escape, no quotes, weird space in the middle. PRs welcome.\n\nThe `preprocess()` function lives in the `preprocess.js` module, which\nyou will have to hack on. PRs welcome.\n\n\nRationale\n---\n\nPHP is way too clunky still. Things like Jinja's filter pipes in Javascript naturally become chains, the script return value naturally becomes the response, I mean, I didn't do much to make all this work, not at all.\n\nJavascript is a fine templating language, when used like this.\n\n\n","maintainers":[{"name":"god.dll","email":"god.DLL@iCloud.com"}],"time":{"modified":"2022-06-18T22:08:10.643Z","created":"2016-06-21T15:30:55.775Z","0.0.1":"2016-06-21T15:30:55.775Z","0.0.2":"2016-06-21T16:03:44.774Z"},"homepage":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe","keywords":["php","web"],"repository":{"type":"git","url":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe.git"},"author":{"name":"Yuli Che.","email":"god.DLL@iCloud.com"},"bugs":{"url":"https://gist.github.com/godDLL/f31224df756fff2623290e331b40b1fe"},"license":"MIT","readmeFilename":"README.md"}