Our great sponsors
-
eta (η)
Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript (by eta-dev)
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
nodejs-server-pages
FastCGI server for using Node.JS in server-side templated pages, in the style of PHP.
-
credo
A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
Eta is a very similar template engine to EJS. It's supposed to be faster, lighter, with async templates.
https://eta.js.org/
https://github.com/eta-dev/eta/
The guys behind it work at Spatie[1] which you have probably heard of some of their packages, and Freek has a blog[2] that has a lot of PHP stuff on - lots Laravel, and lots just general new language stuff (covering PHP8 features etc)
[1] https://spatie.be
Not my cup of tea, but if you really want PHP-like with JS, EJS looks really close to "I wish server-side javascript worked like PHP":
https://ejs.co/
Just needs a FastCGI wrapper.
Another "Node, but PHP like" project that compares itself to EJS and other similar things: https://github.com/Yahweasel/nodejs-server-pages
PHP doesn't do such structural typing, but Psalm[1] can do it statically. It calls them object-like arrays.[2]
[1]: https://psalm.dev/
[1] https://github.com/rrrene/credo/blob/master/lib/credo/check/...
If you really want things to happen fast, you can also take a look at api platform:
https://api-platform.com/