Search code examples
node.jssmartyv8

Rewriting PHP/Smarty site to Node.js


I decided to play a bit with Node.js because I like Javascript a lot as a language and because V8 is so fast. I work with mobile sites a so if I manage to reduce the page response time it will be very good.

I have a relatively simple site built with php and smarty and as an exercise I want to port it to Node and see how it behaves.

My main problem is the following - which of the existing template engines most closely resemble smarty so the porting work of this part of the project to be minimized.

Also I use php library that combines content images into sprites - any image processing tools for V8 that can read/write png and jpeg?


Solution

  • When I search for modules I like to use http://search.npmjs.org and https://github.com/joyent/node/wiki/modules.

    I have never used Smarty, but maybe ejs could be useful? There is a node.js plugin for ejs available. Also maybe you should have a look at all templates modules available at https://github.com/joyent/node/wiki/modules#wiki-templating.

    I searched search.npmjs.org and https://github.com/joyent/node/wiki/modules for png: